Repository navigation
Description
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
- Add an agent to
PULL_MODE_PILOT_AGENTS, recreate the backend, create the agent.docker inspect agent-<name>showsTRINITY_PULL_MODE=true; the agent log shows[#1081] pull pool started. docker rm -f agent-<name>(simulates a lost container).POST /api/agents/<name>/start→ the backend rebuilds the container from the persisted config (bug(recovery): soft-delete recovery dead-ends —recovertells you tostart, butstart404s when the container is gone #1559).docker inspect agent-<name> | grep TRINITY_PULL_MODE→ absent.POST /api/agents/<name>/taskthree 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
src/backend/services/agent_service/lifecycle.py:1621recreate_missing_containerassemblesenv_varsfrom line 1706 and never callspull_mode_env_vars.- The drift-recreate path in the same file calls
pull_mode_env_varsat lines 1194–1197 ("experiment: pull-coordination pilot — route MCP chat_with_agent through the agent queue #946 / feat: pull / work-stealing coordination (push→pull dispatch) #1081 Phase 2: re-apply the pull worker opt-in on recreate"). - Agent create:
src/backend/services/agent_service/crud.py:2038.
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
pavshulin commentedon Oct 12, 2026
/claim
github-actions commentedon Oct 12, 2026
Claimed by @pavshulin. Label
status-in-progressadded.Next steps:
feature/3590-<short-slug>Fixes #3590test(pull): the #3590 writer-set guard also finds an unknown fourth a…
Merge pull request #3632 from Abilityai/feature/3590-rebuild-pull-env
pavshulin commentedon Oct 13, 2026
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 -fon the pull pilot, then the #1559 rebuild (POST /start).TRINITY_PULL_MODE=true) — the rebuild no longer drops it.latest==1.0.0-rc3).successin 3.5 s; stranded non-terminal rows: 0.fix(pull): the Abilityai#1559 rebuild bakes the pull-worker env; one …