fix(context): task-sized workers and compact tool/result references #493

Merged
karsten merged 2 commits from fix/task-sized-context into main 2026-11-15 10:31:39 +00:00
Owner

Scope

Implement the operator's KISS context-efficiency request for Main, Dispatcher workers and Subagents. No 5K total-context gate, no tokenization round trip, no summary-model dependency.

  • Use short task-worker foundation/capability context; retain exact SOUL/USER/operator rules. Historical MEMORY is indexed for all sessions; Main keeps bounded relevant recall.
  • Common model-facing tool-result excerpts with private native-session-bound originals and line-readable views; preserve images, error flags and programmatic structured results. Nested codemode calls keep full data for filtering. Storage failure does not fail completed operations.
  • Fresh native context for a new sequential step, preserving unfinished-step corrections/recovery. No worker effect replay.
  • Ask for concise findings/evidence/uncertainties, not tool dumps. Retain long reports before shortening parent results. Independent validation receives original reports through existing assessment budgets, including reports over 64K; only settled parent-facing results are compacted.
  • Remove exact duplicate host mandate metadata, duplicate skill index and child automatic memory injection.

Verification (head f54e520)

  • npm run typecheck: PASS
  • npm run build: PASS
  • Full npm test: 2613 passed, 1 existing optional skip, 0 failures (2614 total)
  • Actual SDK stream/tool-loop tests for Main and children: compact next request, exact artifact retrieval, no extra summarizer call, preserved authority, status/errors/images and storage-failure fallback.
  • Sequential test: fresh next-step session; original report reaches independent validation before parent shortening. >64K regression has material evidence outside the excerpt.
  • Security review: PASS after fixing original-mandate omission and pre-validation excerpting.

Activation / limitations

Not deployed yet. The old isolated probe imposed an incorrect 90-second overall test deadline. It is replaced by a versioned opt-in probe with no overall deadline, request-local text/reasoning/tool/token activity, and explicit unknown queue/prefill before first progress. A corrected isolated real qwen3.8-flash-next probe PASSED in 138.466 seconds: two requests with reported input 1,585/2,517 tokens, exactly one fixture tool call, 43,304 raw tool characters and a 733-character summary. This verifies an isolated read-only model/tool turn, NOT production activation. Four activity regressions cover >90-second continuing progress, unknown queue/prefill, keepalives versus meaningful own deltas, and frozen completed timings. The versioned probe retains diagnostic artifacts instead of deleting referenced evidence at teardown. No live ledger edits, restarts or model routing changes. Explicit tool allowlists and existing guards/assessment thresholds are unchanged. This does not prove an arbitrary operator prompt/direct MCP schema meets a 5K base-context target, nor resolve every Minerva compaction/recovery problem.

## Scope Implement the operator's KISS context-efficiency request for Main, Dispatcher workers and Subagents. No 5K total-context gate, no tokenization round trip, no summary-model dependency. - Use short task-worker foundation/capability context; retain exact SOUL/USER/operator rules. Historical MEMORY is indexed for all sessions; Main keeps bounded relevant recall. - Common model-facing tool-result excerpts with private native-session-bound originals and line-readable views; preserve images, error flags and programmatic structured results. Nested codemode calls keep full data for filtering. Storage failure does not fail completed operations. - Fresh native context for a new sequential step, preserving unfinished-step corrections/recovery. No worker effect replay. - Ask for concise findings/evidence/uncertainties, not tool dumps. Retain long reports before shortening parent results. Independent validation receives original reports through existing assessment budgets, including reports over 64K; only settled parent-facing results are compacted. - Remove exact duplicate host mandate metadata, duplicate skill index and child automatic memory injection. ## Verification (head f54e520) - npm run typecheck: PASS - npm run build: PASS - Full npm test: 2613 passed, 1 existing optional skip, 0 failures (2614 total) - Actual SDK stream/tool-loop tests for Main and children: compact next request, exact artifact retrieval, no extra summarizer call, preserved authority, status/errors/images and storage-failure fallback. - Sequential test: fresh next-step session; original report reaches independent validation before parent shortening. >64K regression has material evidence outside the excerpt. - Security review: PASS after fixing original-mandate omission and pre-validation excerpting. ## Activation / limitations Not deployed yet. The old isolated probe imposed an incorrect 90-second overall test deadline. It is replaced by a versioned opt-in probe with no overall deadline, request-local text/reasoning/tool/token activity, and explicit unknown queue/prefill before first progress. A corrected isolated real qwen3.8-flash-next probe PASSED in 138.466 seconds: two requests with reported input 1,585/2,517 tokens, exactly one fixture tool call, 43,304 raw tool characters and a 733-character summary. This verifies an isolated read-only model/tool turn, NOT production activation. Four activity regressions cover >90-second continuing progress, unknown queue/prefill, keepalives versus meaningful own deltas, and frozen completed timings. The versioned probe retains diagnostic artifacts instead of deleting referenced evidence at teardown. No live ledger edits, restarts or model routing changes. Explicit tool allowlists and existing guards/assessment thresholds are unchanged. This does not prove an arbitrary operator prompt/direct MCP schema meets a 5K base-context target, nor resolve every Minerva compaction/recovery problem.
fix(context): keep worker tasks small and retain tool details outside prompts
All checks were successful
decision-interface-ci / full-validation (pull_request) Successful in 3m40s
9b43fdcd87
test(context): observe request progress instead of a fixed overall deadline
All checks were successful
decision-interface-ci / full-validation (pull_request) Successful in 3m35s
f54e52054c
Author
Owner

Follow-up proof on f54e520: versioned opt-in real qwen3.8-flash-next probe PASSED without an overall deadline in 234.492s. First request 91.089s / 1,648 input tokens; second 143.357s / 2,614 input tokens. Exactly one fixture tool call; final summary 664 characters. Own emitted-token/text events observed (4/76). Original 43,304-byte tool artifact remains readable and its SHA-256 verified. No live-agent activation claimed. Four activity regressions plus full suite: 2,613 pass, 1 existing optional skip, zero failures.

Follow-up proof on f54e520: versioned opt-in real qwen3.8-flash-next probe PASSED without an overall deadline in 234.492s. First request 91.089s / 1,648 input tokens; second 143.357s / 2,614 input tokens. Exactly one fixture tool call; final summary 664 characters. Own emitted-token/text events observed (4/76). Original 43,304-byte tool artifact remains readable and its SHA-256 verified. No live-agent activation claimed. Four activity regressions plus full suite: 2,613 pass, 1 existing optional skip, zero failures.
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!493
No description provided.