Skip to content

🤖 fix: terminal wakes skip the compaction request's disable-all tool policy - #4052

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/terminal-wake-skip-compaction-tool-policy
Sep 2, 2026
Merged

🤖 fix: terminal wakes skip the compaction request's disable-all tool policy#4052
ibetitsmike merged 1 commit into
mainfrom
mike/terminal-wake-skip-compaction-tool-policy

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Terminal-attention wakes (workflow results, workspace-turn wakes) no longer inherit the compaction request's disable-all tool policy. resolveTerminalWakeCallerSendRestrictions now skips compaction-request rows while walking history for the caller's restrictions, so the wake adopts the row that actually defines the conversation's tool policy.

Background

After a compaction, the newest user row carrying a toolPolicy is the synthetic compaction-request row, whose [{ regex_match: ".*", action: "disable" }] policy exists only for its own summary turn. The wake walk treated it as the caller's restriction, so every terminal wake until the next manual send ran with zero tools (tool configuration ... "toolNames":[] in mux.log). The agent could only answer with text ("Let me inspect the checkout...") and stalled. Observed live on a dogfood workspace whose improve-codebase-architecture workflow finished after a compaction; a paused goal meant nothing re-prompted it.

Implementation

Same doctrine as resolveParentAutoResumeOptions, which already excludes the compact identity: the compaction row is a per-turn policy, not a caller restriction, so the backward walk skips it and keeps going.

Validation

  • New test: "workflow wakes skip the compaction request's own disable-all tool policy". It seeds a restricted manual row (^bash$) followed by a compaction row and asserts the wake carries the manual restriction; a second run seeds an unrestricted manual row plus compaction and asserts the wake has no toolPolicy.
  • Red-green: with the skip stubbed out, the test fails with the incident's exact signature (received the .* disable policy instead of ^bash$).

Risks

Low. The change only affects which user row the terminal-wake walk adopts, and only when a compaction row sits between the wake and the last manual send. Workspaces on older builds still hit the stall after their next compaction until upgraded; a manual message clears it.


Generated with xum • Model: anthropic:claude-fable-5-1 • Thinking: xhigh • Cost: $8.76

…policy

resolveTerminalWakeCallerSendRestrictions walked history backward and adopted
the newest user row carrying a toolPolicy. After a compaction, that row is the
synthetic compaction-request (toolPolicy: .* disable), so every workflow-result
and workspace-turn wake until the next manual send ran with zero tools: the
agent could only announce its next step and end the turn (finishReason stop).

Skip compaction-request rows in the walk; their per-turn policy only governs
the summary turn and is not a caller restriction. Red-green covered by the new
taskService test (received .* disable instead of the caller's ^bash$ before the fix).

---

_Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking: `xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=xhigh costs=0.00 -->
@chatgpt-codex-connector

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d23580123c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 1880f12 Sep 2, 2026
50 of 56 checks passed
@ibetitsmike
ibetitsmike deleted the mike/terminal-wake-skip-compaction-tool-policy branch September 2, 2026 08:19
asm pushed a commit to asm/mux that referenced this pull request Sep 2, 2026
## Summary

Version bump for the v0.28.4 patch release. The headline change since
v0.28.3 is Gemini 3.8 Flash becoming the default Gemini Flash model
(coder#4060). The release also carries browser Login with Coder on remote Xum
servers (coder#4047), the opt-in project bundle for settings backup (coder#4043),
the connection-indicator slow-response surfacing (coder#4059), send-queue and
terminal-wake fixes (coder#4053, coder#4052), and the Effect Phase 11 runtime
refactors.

## Implementation

Bumped with `node ./scripts/set-package-version.js 0.28.4` so the root
`package.json` and the legacy `packages/mux-compat` forwarding package
stay version-locked (the v0.28.3 bump missed the compat package and
broke `Test / Unit` on main, fixed in coder#4048).
`src/common/compat/productIdentity.test.ts` passes locally.

After this PR merges, the `v0.28.4` tag will be applied to the squash
commit and the GitHub Release published to trigger the
desktop/npm/docker pipelines.

---

_Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking:
`medium` • Cost: `$0.00`_

<!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=medium
costs=0.00 -->
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