fix(context): teach result handling and avoid accumulation/polling overhead #501

Merged
karsten merged 1 commit from fix/context-contract-latency into main 2026-11-15 18:24:58 +00:00
Owner

Explicit operator request

Minerva is still slow; verify/update the SYSTEM PROMPT so Main/Dispatcher/workers know how to consume retained/excerpted/structured/grouped tool returns. Prior #498 pressure/lifecycle work remains delivered and is not reopened.

Implementation

  • Shared source-owned result protocol actually injected into ordinary Main, Dispatcher-worker and Subagent SDK system context: raw vs structured vs excerpt vs worker synthesis vs verification; targeted original reads; no result-retrieval replay; individual call/error/uncertainty handling; no eager full-archive reads or extra per-tool summarizer.
  • Ready-dispatcher capability guidance explains exact submit argument names, existing Main tool guards, retaining execution identity and yielding for asynchronous work instead of busy-polling unchanged ready/running tasks. No new gate or completion authority.
  • Optional worker-authored hayate-task-report-v1 schema supports semantic synthesis in the EXISTING working model turn. Long valid reports retain exact originals; projected findings/changes/evidence remain labelled excerpts; uncertainty/remaining arrays stay exact. Unknown schemas fall back honestly. Required STEP-STATUS/plain reports remain valid.
  • Existing pruning preference now covers MANY small older tool payloads through scoped exact evidence/index references. Preserve all call/result pairs, IDs, error flags, recent results, images and structured machine fields. Native archives unchanged; storage/index failure preserves input; no hard total-context gate.
  • More plugin schemas are relevance-discovered instead of eager on local/unrestricted worker catalogs; explicit allowlists/frontier Main behavior unchanged.
  • Own reasoning/tool-argument deltas drive bounded metadata activity without exporting private reasoning or arguments.

Evidence

Real SDK tests exercise Main/worker/subagent projection, targeted retained originals, exact errors/uncertainty, repeated-small-result indexing, no extra summary inference/effect replay, disabled/failed storage and discovery. Typecheck/build and independent review PASS; 49 focused tests PASS. Exact-head full local suite PASS: 2636 passed, 1 existing optional skip, 0 failures (2637 total). Exact-head CI required before merge.

Latency honesty

Read-only live evidence shows real requests taking 8–21 minutes plus five-minute timeouts. Main repeatedly attempted host-blocked bash and polled an unchanged ready task, now addressed in guidance. Backend observation separately found a standalone 4-session/131072-token DS4 process, not the documented 2-session resident RDMA runtime; live prefill around50–100t/s and decoding falling near0.7–1t/s while other sessions prefill, with cold-prefix/cache-eviction churn. These backend observations are NOT per-request correlation or a claim that this Core PR solves serving performance. No busy inference backend was restarted or model silently switched.

A separate concurrent editor changed structured-context worktree authority prompts; this PR uses a fresh isolated worktree and excludes those unrelated changes.

## Explicit operator request Minerva is still slow; verify/update the SYSTEM PROMPT so Main/Dispatcher/workers know how to consume retained/excerpted/structured/grouped tool returns. Prior #498 pressure/lifecycle work remains delivered and is not reopened. ## Implementation - Shared source-owned result protocol actually injected into ordinary Main, Dispatcher-worker and Subagent SDK system context: raw vs structured vs excerpt vs worker synthesis vs verification; targeted original reads; no result-retrieval replay; individual call/error/uncertainty handling; no eager full-archive reads or extra per-tool summarizer. - Ready-dispatcher capability guidance explains exact submit argument names, existing Main tool guards, retaining execution identity and yielding for asynchronous work instead of busy-polling unchanged ready/running tasks. No new gate or completion authority. - Optional worker-authored hayate-task-report-v1 schema supports semantic synthesis in the EXISTING working model turn. Long valid reports retain exact originals; projected findings/changes/evidence remain labelled excerpts; uncertainty/remaining arrays stay exact. Unknown schemas fall back honestly. Required STEP-STATUS/plain reports remain valid. - Existing pruning preference now covers MANY small older tool payloads through scoped exact evidence/index references. Preserve all call/result pairs, IDs, error flags, recent results, images and structured machine fields. Native archives unchanged; storage/index failure preserves input; no hard total-context gate. - More plugin schemas are relevance-discovered instead of eager on local/unrestricted worker catalogs; explicit allowlists/frontier Main behavior unchanged. - Own reasoning/tool-argument deltas drive bounded metadata activity without exporting private reasoning or arguments. ## Evidence Real SDK tests exercise Main/worker/subagent projection, targeted retained originals, exact errors/uncertainty, repeated-small-result indexing, no extra summary inference/effect replay, disabled/failed storage and discovery. Typecheck/build and independent review PASS; 49 focused tests PASS. Exact-head full local suite PASS: 2636 passed, 1 existing optional skip, 0 failures (2637 total). Exact-head CI required before merge. ## Latency honesty Read-only live evidence shows real requests taking 8–21 minutes plus five-minute timeouts. Main repeatedly attempted host-blocked bash and polled an unchanged ready task, now addressed in guidance. Backend observation separately found a standalone 4-session/131072-token DS4 process, not the documented 2-session resident RDMA runtime; live prefill around50–100t/s and decoding falling near0.7–1t/s while other sessions prefill, with cold-prefix/cache-eviction churn. These backend observations are NOT per-request correlation or a claim that this Core PR solves serving performance. No busy inference backend was restarted or model silently switched. A separate concurrent editor changed structured-context worktree authority prompts; this PR uses a fresh isolated worktree and excludes those unrelated changes.
fix(context): teach result protocol and bound retained evidence projection
All checks were successful
decision-interface-ci / full-validation (pull_request) Successful in 3m35s
7968decbe9
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!501
No description provided.