Repository navigation
fix: reasoning distillation budget, hook-forced ask input and DAG node questions - #717
Merged
Merged
Conversation
…cements - Reconcile each organizer reservation with reported usage so long sessions keep distilling; refund calls without a response and pause only after three consecutive failures. - Skip reasoning too small to repay the call and drop replacements that are not smaller; only the explicit marker clears a part in multi-part batches. - Add reasoningDistillation.language (zh default, en) for organizer prose. - Build a completed-turn-only snapshot on the turn-end path instead of hashing the whole session. - Core runner honours the auxiliary timeout flag and a declared none variant. - Document that compatibility records only gate the legacy wire projector. Refs #714
- The forced dialog and PermissionRequest hooks receive the input the tool will run with, including updatedInput; the tool's own checks use it too. - TUI and web app show the hook reason and the effective input, and hide "Allow always" when a request has nothing to remember. - A confirmed forced ask settles ask-level rules for the same call without a second dialog; deny rules still apply. - Log an ignored PermissionRequest allow and document forced-ask semantics, including approval under run --dangerously-skip-permissions. Refs #715
…nt answers Nodes ask their owning parent through the agent tool instead of the user, and the parent answers with a conclusion grounded in the user's instructions or checked evidence, stating remaining uncertainty and a safe course otherwise. Refs #716
…odel input - TUI shows a bounded preview of the effective input (path and content or arguments) for tools without an input-based view, such as edit, write, apply_patch and MCP tools; the web dock shows full arguments, not only a path. - Tool parts keep the model's own input while the rewritten input runs, so history and doom-loop detection still compare model calls. Refs #715
…lock - Core runner refunds an admitted organizer call interrupted before a response; the previous flag never ran because interruption does not resume. - OpenCode host aborts the organizer on interruption and waits for its accounting while the per-session lock is held. Refs #714
LeXwDeX
marked this pull request as ready for review
October 8, 2026 08:11
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The dock now hides "Allow always" when a request has no pattern to persist, so the fixture with always: [] shows two actions. Assert the exact actions for both cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #714
Closes #715
Closes #716
Why
A review of opt-in reasoning distillation found that it silently stopped after about ten turns per session, paused permanently after one transient failure, did quadratic work on the turn-end foreground path, and could adopt replacements longer than their source. A review of hook-forced permission asks found that users could approve one input while the tool ran a hook-rewritten one, and that a confirmed call could prompt twice. DAG nodes also had no guidance to ask their parent rather than the user, and the parent had none on how to answer.
Type of change
What changed
reasoningDistillation.language(zhdefault,en); turn-end snapshot limited to the completed turn; core runner honours the auxiliary timeout flag and a declarednonevariant;compatibilitydocumented as legacy-only.updatedInput); TUI and web app show it with the hook reason (bounded generic preview for edit/write/MCP tools) and hide "Allow always" when nothing would persist; a confirmed forced ask settles ask-level rules for the same call while deny rules still apply; tool parts keep the model's own input; ignored PermissionRequestallowlogged; semantics documented.agenttool and orchestration policy route node questions to the owning parent and require grounded parent answers.What does this PR do?
Narrow fixes with regression tests. Adds one optional config field (
reasoningDistillation.language); the regenerated v2 SDK type differs only by that field. No database schema, event identity or route change.Evidence
Local, on this head:
bun run lint: 4796 warnings (main: 4796; cap 4850)bun run typecheck: 31/31prompt.test.tscases hit the 30 s timeout under host load, andprompt.test.tsalone passed 158 / 0bun run test:dag-core: all critical behavior and coverage floors passedbun run test:httpapi: 239 scenarios, 0 fail/skip/missingpackages/clientgenerate +packages/sdk/jsbuild: only the intendedlanguagefieldscript/release-notes.tsforgraphagent-v1.0.64How did you verify your code works?
New regression tests fail on the previous code (budget exhaustion, failure pause, interrupt refund, rewritten-input dialog, single confirmation). Isolated live checks used the configured DeepSeek and GLM models with a temporary config and database: a 3,309-character reasoning part was organized by one small-model call into 909 Chinese characters and adopted, with the reservation reconciled to reported usage; reasoning under the minimum was skipped without a call. An independent review of the diff found one medium and three low issues; all were fixed with tests.
Screenshots / recordings
Exercised in the TUI (attached to an isolated server) and the web app: a hook-forced ask with a rewritten command shows the hook reason, the rewritten command and only "Allow once / Reject"; approving runs the rewritten command once with no second dialog. A forced file write shows its path and content preview and was rejected without writing.
Checklist
🤖 Generated with Claude Code