Sub-agents cannot reliably execute: wall-time deaths lose uncommitted work, provider-route failures block dispatch, shell tooling needs workarounds
- Dominant language
- Rust
- Stars
- 41k
- Forks
- 3.6k
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 299
Description
## Summary
Sub-agents (workers/builders) cannot reliably run shell commands in this environment, which makes delegated execution work — the core Fleet value proposition — unusable. Three failure modes observed today alone:
1. **Wall-time budget deaths mid-task.** Two worker sub-agents (117 and 83 steps in) hit the 1800s wall-time limit and were killed with all uncommitted work. One had a complete, correct fix uncommitted (the sub-agent transcript scroll fix); the other produced nothing. The runtime's own lessons file (GROK-UX-LESSONS-20260820.md section 0) documents the same class of failure killing research sub-agents: a scout died at 60/60 steps with no report. Budget death must produce a final report from the checkpoint and force-commit uncommitted work, not silently discard it.
2. **Provider-route brittleness blocks dispatch entirely.** Fleet profiles pinned to xAI (`builder`, `reviewer` on grok-4.6) fail at start with "client could not be built" even after `codewhale auth external-consent --provider xai --mode read-only` succeeds and saves consent — fresh processes still fail, so the consent path in the shipped 0.9.10 binary does not resolve credentials the runtime itself just persisted. There is no fallback: the task never starts.
3. **Shell execution from sub-agents is unreliable/hostile to long commands.** Background jobs get parked to /jobs with completion arriving as runtime events that may or may not surface; heredocs with certain payloads fail to spawn at all ("nul byte found in provided data"); interleaved foreground/background waits make multi-step verification (edit → revert → test → restore) awkward enough that the parent ends up doing the work itself — defeating the point of delegation.
## Expected
- A sub-agent should be a first-class executor: reliable shell foreground execution with captured exit codes, straightforward file read/write (including binary-safe edits), and predictable background-job semantics.
- Budget exhaustion = graceful landing (final report + commit of finished pieces), never silent loss.
- Route failures (missing provider creds) should fall back or queue with a clear operator-facing signal, not fail the dispatch.
- The parent's own shell tooling should not need workarounds (python-script files instead of heredocs, split greps instead of single pipelines) for routine multi-step verification.
## Evidence
- Session of 2026-08-20: two `subagent_failed` events (`wall_time_budget`, 1800s, 83 and 117 steps) — one left salvageable uncommitted WIP in `/Volumes/VIXinSSD/CW/worktrees/cw-0911-subagent-scroll-20260820`, the other nothing.
- `codewhale auth external-consent --provider xai --mode read-only --path ~/.grok/auth.json --yes` → "saved read-only external credential consent" (exit 0), yet `builder`-profile dispatch still fails with "xAI OAuth credentials not found"; `codewhale --provider xai --model grok-4.6 exec ...` in a fresh process fails the same way.
- GROK-UX-LESSONS-20260820.md documents the step-budget death pattern and recommends soft-landing + report-on-exhaustion.
## Impact
Delegation is currently a trap: dispatch succeeds, work proceeds, and then everything is lost at a hard limit or a route error. Until this is fixed, heavy lanes must stay with the parent session, which concentrates risk and burns the primary budget.
Contributor guide
Research direction
Start by reproducing the three reported failures: wall-time termination, xAI provider dispatch after external-consent, and long or background shell commands. Read GROK-UX-LESSONS-20260820.md section 0 and inspect the cited worktree for salvageable changes. Done means completed work is preserved with a final report, provider failures produce a clear fallback or queue signal, and routine shell execution is predictable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- ai-infra-agents, cli, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100