Skip to content

fix: bound delegated recall and reserve answer time - #1282

Open
igs-rogenlo wants to merge 1 commit into
Martian-Engineering:mainfrom
igs-rogenlo:task187-bounded-recall-20261105
Open

igs-rogenlo wants to merge 1 commit into
Martian-Engineering:mainfrom
igs-rogenlo:task187-bounded-recall-20261105

Conversation

@igs-rogenlo

@igs-rogenlo igs-rogenlo commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Delegated lcm_expand_query navigation can keep issuing tools after retrieval stops yielding source content. The source-token grant does not bound tool turns: residual budgets can repeatedly return zero-token expansions without being exhausted, and the child reaches its work deadline without a final answer.

This adds an executable transition from navigation to a bounded, tool-free evidence answer. Ordinary terminal child replies keep their existing path.

Changes

  • Observe the owned child's existing session messages in bounded polling slices. Deduplicate snapshots; end navigation after 24 model-issued tool calls, three consecutive empty/repeated/error results, or the retrieval time budget.
  • Retain up to 32,000 characters of model-visible tool evidence. Distinguish empty tool content and native retrieval counters from zero-token subtree manifests.
  • Reserve up to 30 seconds, capped at one quarter of the remaining work budget, for child teardown and an answer. Await deletion of the owned navigator and revoke its grant before one runtime.llm.complete call. Synthesis has no tools, uses the original work deadline and cancellation signal, and validates citations against the selected seed bucket.
  • Mark synthesized partial coverage truncated: true; report insufficient evidence explicitly. A cleanup failure prevents synthesis. A synthesis policy rejection does not spawn another navigator or retry on another model.
  • Forward optional cancellation/purpose through the existing runtime LLM bridge. Keep source-token grants, model endpoints, and caller token/time budgets unchanged.

Model policy and scope

The answer pass uses the canonical expansion model (or the model observed in the child). It is checked by OpenClaw's llm model policy, separately from the existing subagent policy; README examples and tool docs now show both. No allowlist is automatically widened. enableSummaryThinking: false also requests non-thinking synthesis. Existing compaction callers retain their default purpose.

This is separate from source-message delivery in #1080 / #1261, Code Mode envelopes in #1250, and shared cross-conversation deadlines in #994. It does not attempt the broader deterministic accounting proposed in #575; observed grant debits are only a lower bound on returned source-token estimates.

Evidence and validation

Two redacted local traces motivating this change reached 71 and 87 assistant tool-use turns with reasoning disabled and no final answer. They retained 84 and 126 tokens of a 4,000-token expansion grant; 10/19 and 41/45 expansion calls returned zero tokens. No original prompts, transcripts, credentials, account identifiers, or production data are included in this PR.

  • New fixtures are synthetic. The evidence-synthesis regression fails on untouched upstream c3745b0; the broader new convergence scenarios yield seven failures and two control passes before the fix.
  • Current committed new regressions: 17/17 passed. The final local full run on macOS / Node 26.5.0 passed 2,157/2,159. plugin-tool-session-scope and plugin-reload-generations hit their 30-second test harness deadlines; the scope test also times out on untouched upstream. Reload-generations passed the focused selection. Neither timeout was reproduced in GitHub CI on Node 22. No product timeout was changed.
  • GitHub CI for this commit passed 2,159/2,159 tests, typecheck and Go TUI tests, plus the OpenClaw plugin inspector and smoke import against the latest published OpenClaw: https://github.com/Martian-Engineering/lossless-claw/actions/runs/41963367564 .
  • Local typecheck, all builds, Go TUI tests, package dry run, and git diff --check passed. Local validation remains distinct from live model acceptance.

Production validation

The correction has been installed as a scoped overlay on a production OpenClaw 2026.10.7 instance. The native plugin reload advanced its runtime generation without a Gateway restart; model policy, endpoints, and product budgets stayed unchanged.

A real-data query with the original normalized prompt/seed/numeric parameters completed in 52.354 seconds, returning a 2,272-character partial answer with two citations verified inside the original conversation. Seven source messages / 4,813 characters matched stored source parts and were visible to the navigator; five retained content beyond character 200. The navigator used Qwen with thinking off and reported zero reasoning tokens.

Its archive contains 20 assistant turns, all toolUse, and no JSON answer. Replaying the deployed progress code against those messages reports no_progress (22 model-issued tool calls, four consecutive no-progress results, 32,000 retained evidence characters). The owned navigator was archived before the tool returned its answer. Together with the deployed control flow, this verifies the bounded evidence-answer path rather than treating a healthy load as answer acceptance.

Limits of this evidence:

  • The result is explicitly truncated: true. Full semantic sufficiency of the business answer is not established.
  • The caller first mistyped a summary ID and received a two-millisecond validation failure, then corrected it. The complete parent turn took 88.468 seconds. The requested single-call instruction was therefore not satisfied; this is technical evidence for the successful specified query, not a clean whole-caller E2E.
  • Native validation kept the genuine CLI connection open through completion because the host's observation scope includes client.connectionSignal. Only transport waiting was separated; the parent limit (150 seconds), original tool timeout (150 seconds), and output limit (1,500 tokens) were unchanged.
  • The finite read-only observer is still collecting natural traffic. There are not enough independent natural delegated queries to estimate a fleet-wide timeout or latency improvement. This single case is not a throughput benchmark or a zero-error SLA.

The limits deliberately produce partial evidence rather than asserting that the store has no answer. No original prompts, transcripts, source text, credentials, or account identifiers are included here.

中文摘要

修正委派檢索持續查找、沒有收斂成答案的機制:以程式控制無進展/工具呼叫/時間邊界,先清理本次子任務,再用已取得證據做一次不帶工具的回答。保留原授權與額度;未完成範圍明示截斷或資料不足。已在正式真資料查詢驗到Qwen/off、本文與有效引用,並確認導航停止後能回傳部分答案;自然委派流量與完整業務語義品質仍待觀察。

AI assistance: implemented and tested with OpenAI Codex. All committed fixtures are synthetic.

This branch has not been deployed

No deployments
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