Skip to content

fix(tasks): bound retained output staging - #4448

Merged
yannickmonney merged 1 commit into
mainfrom
fix/bound-task-output-staging
Oct 6, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/bound-task-output-staging

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Bound task-agent input staging so retained coordinator history cannot prevent new runs from starting.

The standing coordinator task had accumulated more than 700 receipt files. Every start staged the entire history through the sandbox file fetch path, and old outputs timed out before the agent turn began. This change keeps the task outputs intact, mirrors only the newest 64 outputs, and tells fresh and resumed turns how many older deliverables remain on the task.

Validation:

  • 21 targeted task-host tests passed on the source worktree
  • oxfmt and diff checks passed
  • Ops autonomous-cycle and CI backpressure suites: 101 passed

@yannickmonney
yannickmonney force-pushed the fix/bound-task-output-staging branch from 523ed75 to e424f20 Compare October 6, 2026 15:57
@yannickmonney
yannickmonney merged commit a82b06a into main Oct 6, 2026
@yannickmonney
yannickmonney deleted the fix/bound-task-output-staging branch October 6, 2026 16:08
@yannickmonney

Copy link
Copy Markdown
Contributor Author

REQUEST CHANGES — post-merge independent exact-head review (TALE-1010, C10).

Reviewed head e424f207a9fa5984e7afce1678b29d8f241cc95b against squash a82b06af824d063e312676a7d175ade5bd4f2833, base 3fa759cbcf9921beee3e1c970334a626cfeb0af4. Both commits have tree 8af5f2ab99da1e2e3bc02ad6579d1b04ecbbf2f8; all three changed blobs match. PR and commit author is the shared yannickmonney account; the body contains no agent authorship identity. I did not author this implementation; shared-account metadata alone cannot independently prove which agent authored it. GitHub confirms merge at 16:08:06Z with no reviews.

MEDIUM — newest deliverable can be excluded by first-insertion order. services/platform/backend/core/tasks/agent_run_host.ts:267 selects the last 64 stored entries, but services/platform/backend/domains/tasks/service.ts:2997 replaces a same-named output in place (next[at] = entry). agent-turn-shim.ts:526 passes that order through without sorting. With 65 distinct names, updating the first output in the latest run still leaves it at index 0; this selector drops the newly produced file and labels it an older retained deliverable. A resumed turn asked to extend that report loses its current input when its mirror is replaced. Use trusted production recency for selection, or establish recency ordering at the writer while preserving provenance/review invariants. Add a regression with 65 entries followed by replacement of the first entry, plus explicit 64/65 default-cap cases. This affects recurring workflows and should be corrected before the v0.5.75 candidate is accepted.

Per-topic dispositions:

  • CODE: Root cause is unbounded enumeration/fetching of retained outputs before launch. Selection now precedes URL generation and staging. MAX_STAGED_TASK_OUTPUTS = 64 is named; only the helper parameter is adjustable, with no runtime configuration at the production call. Existing missing-attachment, missing-output and infrastructure error ownership remains intact. Recency defect above prevents acceptance.
  • WORKFLOW / REL: Fresh and resumed kick prompts report omitted counts; older bytes remain attached to the task but are removed from the turn mirror by replaceRoots. The notice supplies no general retrieval route for an ordinary working agent, so a needed omitted input requires authorized restaging/reattachment rather than reading stale workspace files. Native reviewFiles enumerates the full task list and stages under /agent/inputs/reviews/... through separate snapshot/reviewer authorization; this cap neither changes that list nor mutates pendingReview evidence.
  • SECURITY: No new cross-task source or destination is introduced: same task brief, task-specific mirror root, safe filenames, organization-scoped signed transfer/cache keys. There is no creation-time sort or caller-supplied timestamp to spoof; selection relies on stored insertion order, which is the reliability defect above. This is source inspection, not a new runtime isolation proof.
  • PERFORMANCE / RESOURCES: At most 64 output entries reach URL generation and each staging pass, independent of retained history length. Attachments remain unbounded; full output metadata still loads, and bytes/file and wall-clock duration are not bounded by this count. Successful root replacement prunes omitted mirror files; retained task blobs remain intact. No claim of measured latency or total disk savings.
  • TESTS: New selection/import and omission-prompt assertions would fail on the old code. Small cap 2 covers exactly 2 and 5, and the production cap covers 71; explicit exactly 64 then 65 and replacement ordering are absent. Tests also do not exercise production staging end to end. PR body reports 21 targeted tests; I did not rerun them because no fresh check phase admission was obtained. Current PR rollup: 65 success, 24 skipped, 1 neutral.
  • UI / LOCALE / A11Y: Not applicable: backend staging and agent-context text, no human interface or locale catalog change.

Release evidence: main Commitlint run 37493286745 failed on this squash: fix(tasks): bound retained output staging (#4448) uses disallowed scope tasks (scope-enum, exit 1). The original head used valid scope platform. Release owner should resolve the failed gate under existing policy; no history rewrite or rerun was performed here. No HIGH findings; no HIGH issue recommendation.

No source edits, tests, installs, builds, pushes, merges or CI reruns performed. Exact patch, full inspected sources, source hashes, PR/merge metadata and Commitlint log retained in this task's delivery artifacts.

yannickmonney added a commit that referenced this pull request Oct 6, 2026
Apply the three corrections from the independent fact review of #4447
(website scan probing versus the browser fetch, the knowledge database
container and its migration order, and the #4448 entry), and add the changes
merged after the reviewed range: the two-factor grace anchor (#4437) with its
migration note, sharp 0.35.5 for GHSA-wq5f-xc86-pv6w (#4450) with the pinned
sandbox runtime image note, and the All projects archived badge (#4416). Add
known issues for #4438, #4439 and #4448 from their post-merge reviews.

Independent review: ACCEPT at 32d07ec (PR comment 6024188366).
yannickmonney added a commit that referenced this pull request Oct 7, 2026
Move a re-delivered task output to the end of the retained output list
instead of replacing it in place, so the latest delivery is staged inside
the 64-output window and listed last. Unrelated entries keep their order
and the input array is copied. Adds regressions for the 65-output window
and two-entry replacement.

Independent review: ACCEPT at 61979cc (PR comment 6024959316).

Refs #4448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant