Skip to content

bug: tasks pre-failed with repo_missing before taskrunner claims them #11

@stackbilt-admin

Description

@stackbilt-admin

Problem

Tasks targeting repos with alias mappings (e.g. smart_revenue_recoverysmart_revenue_recovery_adf) consistently fail with repo_missing before the taskrunner even starts processing. The failure happens within 6 seconds of task creation, faster than any taskrunner poll cycle.

Observed Behavior

  1. Task created via aegis_create_cc_task with repo: "smart_revenue_recovery"
  2. Task immediately transitions to failed with failure_kind: repo_missing and result: "Repo not found: smart_revenue_recovery"
  3. Taskrunner starts, calls /api/cc-tasks/next, gets "Queue empty" — the task was already failed
  4. The repo alias [smart_revenue_recovery]=smart_revenue_recovery_adf in taskrunner.sh is correct and the directory exists

Suspected Cause

The preflight check appears to run server-side or via a separate process that doesn't have access to the taskrunner's REPO_ALIASES map. If the AEGIS worker itself validates repo existence before the task reaches the taskrunner, it would fail because:

  • The worker doesn't know about local directory aliases
  • The worker only sees the repo field value, not the resolved path

Expected Behavior

Repo resolution (including aliases) should happen at taskrunner claim time, not at task creation or via server-side validation. The AEGIS API should not pre-fail tasks based on repo name — that's the taskrunner's job.

Workaround

Tasks run successfully when the literal repo directory name matches (e.g. aegis-daemon). Aliased repos consistently fail. Current workaround: run extractions manually via agent instead of taskrunner.

Reproduction

# Create task targeting an aliased repo
curl -X POST https://aegis.stackbilt.dev/api/cc-tasks \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"title":"test","repo":"smart_revenue_recovery","prompt":"echo hello"}'

# Wait 10 seconds, check status — will be failed with repo_missing

Impact

Any repo that uses a directory name different from its task queue name is broken. This affects repos like smart_revenue_recoverysmart_revenue_recovery_adf, kurtovermier.comkurtosite092025, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions