Skip to content

bug(pull): recreate_missing_container rebuilds a pull pilot without the pull env — its queue stalls silently #3590

Closed

Description

@pavshulin

Summary

The "rebuild missing container" path (#1559: a live agent_ownership row but no container) recreates a pull-pilot agent without the pull env (TRINITY_PULL_MODE, TRINITY_MAX_PARALLEL_TASKS). The backend still routes the agent's work to the durable pull queue because the agent is in PULL_MODE_PILOT_AGENTS, but the recreated container runs no pull worker. Every task queues forever with no warning. A recreate triggered by config drift (resources change + stop/start) rebuilds correctly and the backlog drains.

The related "pool is not resized when the capacity setting changes" half is already tracked as #3039; this issue is only the rebuild path.

Build: v1.0.0-rc2 (96f88f9) · Matrix row: B9 (abilityai/trinity-enterprise#847) · Env: from-source dev stack, PostgreSQL, PULL_MODE_PILOT_AGENTS=<agent>

Steps

  1. Add an agent to PULL_MODE_PILOT_AGENTS, recreate the backend, create the agent. docker inspect agent-<name> shows TRINITY_PULL_MODE=true; the agent log shows [#1081] pull pool started.
  2. docker rm -f agent-<name> (simulates a lost container).
  3. POST /api/agents/<name>/start → the backend rebuilds the container from the persisted config (bug(recovery): soft-delete recovery dead-ends — recover tells you to start, but start 404s when the container is gone #1559).
  4. docker inspect agent-<name> | grep TRINITY_PULL_MODE → absent.
  5. POST /api/agents/<name>/task three times.

Observed

Three execution rows stay queued (9 minutes in the test) with no operator alert, no log warning. The agent reports healthy. After a resources change plus stop/start (the drift-recreate path) the container gets the pull env back and the three rows run.

Expected

Both recreate paths produce the same container env. A pilot agent without a pull worker should either not be routed to the pull queue or raise a platform alert ("pilot has no worker").

Where

Suggested fix

Apply the same set-or-clear block (PULL_MODE_ENV_KEYS pop + pull_mode_env_vars(agent_name) update) in recreate_missing_container before the container run, so the three env-assembly sites agree. Add a parity test that the rebuild-from-nothing env contains the pull keys for a pilot.

Regression?

No (pull pilots are opt-in and flag-gated), but it is a silent data-path loss for anyone who runs a pilot.

Activity

  1. added
    priority-p2
    type-bug
    theme-reliability
    on Oct 12, 2026
  2. pavshulin commented on Oct 12, 2026

    @pavshulin
    ContributorAuthor

    /claim

  3. added
    status-in-progress
    on Oct 12, 2026
  4. github-actions commented on Oct 12, 2026

    @github-actions

    Claimed by @pavshulin. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/3590-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #3590
  5. added 2 commits that reference this issue on Oct 12, 2026
  6. pavshulin commented on Oct 13, 2026

    @pavshulin
    ContributorAuthor

    rechecked on rc3 15e3502c0 — pass.

    Env: pash (PG profile). Fixer≠verifier: code = the PR #3632 approval; live leg on the deployed tag = mine.

    Repro (the issue's own): docker rm -f on the pull pilot, then the #1559 rebuild (POST /start).

    • Recreated container carries the pull-mode env (TRINITY_PULL_MODE=true) — the rebuild no longer drops it.
    • The pilot landed on the NEW base image by itself (latest == 1.0.0-rc3).
    • Post-rebuild dispatch: queued → claimed → success in 3.5 s; stranded non-terminal rows: 0.
  7. added a commit that references this issue on Oct 13, 2026
    220ca09
  8. added
    status-in-dev
    complexity-medium
    and removed
    status-in-progress
    on Oct 17, 2026
  9. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpriority-p2theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions