prompt the accept-edits switch when the operator owns deploys - #84
Merged
Merged
Conversation
work-on-task-assistant Phase 5 already extracts the deploy workflow and prints who runs the mutations. That is not enough on its own: observed 2026-08-16, the block correctly said 'the operator runs the cluster mutations' and the session still spent ~40 minutes handing back command blocks to paste, until the owner interrupted with 'as always, I don't want to run any commands — you should suggest switching to the edit mode'. The split says who may run the command. The added line makes the permission-mode switch that lets the agent actually run it in-session, and fires only when the extracted workflow assigns cluster/deploy mutations to the operator.
There was a problem hiding this comment.
Now I have a complete picture. Let me compile the review.
Summary of Changes:
- CHANGELOG.md — Added
## Unreleasedsection with a feat entry describing the change. - agents/work-on-task-assistant.md — Added a "Permission-mode precheck" bullet in Phase 5 that detects when extracted workflows assign cluster/deploy mutations to the operator and appends a verbatim line instructing the user to switch permission mode via Shift+Tab.
Review Report
Must Fix
None. No security vulnerabilities, no correctness bugs, no data issues.
Should Fix
None.
Nice to Have
agents/work-on-task-assistant.md:161— TheShift+Tabinstruction is UI-specific. If the Claude Code UI changes this mechanism, the instruction becomes stale without any code change to flag it. Consider adding a brief note that this instruction reflects the UI at time of writing (2026-08-16), or structuring the line so the UI mechanism is parameterized rather than hardcoded. (Not a bug — the rationale paragraph correctly explains why this specific instruction was added based on the 2026-08-16 observation.)
Toolchain Gap
- ast-grep-runner.sh unavailable — The runner script at
$CLAUDE_PLUGIN_ROOT/scripts/ast-grep-runner.shcould not be accessed due to sandbox restrictions blocking paths outside the working directory. The ast-grep binary itself is present (/usr/bin/ast-grep) but the aggregated runner (which also handles script-tier rule checks) is unreachable. Mechanical funnel was skipped per Step 4.0 fail-fast.
Plan Concerns — Addressed
| Concern | Status |
|---|---|
| Phase 5 conditional logic correctly identifies all mutation types | ✅ Addressed — make apply, make buca, kubectl writes, helm install/upgrade, ssh deploys, prod runbook steps are all explicitly listed and the condition correctly gates on "operator rather than the agent" |
| Shift+Tab instruction may become stale with UI changes | |
| Appends cleanly when no deploy steps exist | ✅ Addressed — the precheck is inside the "If code task" block and gated on the workflow assigning mutations to the operator; if either condition is false, nothing is appended |
{
"verdict": "approve",
"summary": "PR adds a permission-mode precheck to Phase 5 of work-on-task-assistant that detects when the extracted workflow assigns cluster/deploy mutations to the operator and appends a verbatim line instructing the user to switch to accept-edits mode via Shift+Tab. The change is well-reasoned (documenting a real 40-minute failure observed 2026-08-16), the conditional logic covers all listed mutation types, and the append integrates cleanly within the existing Phase 5 structure. No correctness or security issues found.",
"comments": [
{
"file": "agents/work-on-task-assistant.md",
"line": 166,
"severity": "nit",
"message": "Shift+Tab is UI-specific. If Claude Code's UI changes this mechanism, the instruction becomes stale without any code change to flag it. Consider a note that this reflects the UI at 2026-08-16, or parameterizing the UI mechanism."
}
],
"concerns_addressed": [
"correctness: Phase 5 conditional logic correctly identifies all mutation types (make apply, make buca, kubectl writes, helm install/upgrade, ssh deploys, prod runbook steps) — addressed",
"correctness: Shift+Tab instruction may become stale with UI changes — acknowledged as inherent risk, rationale paragraph documents the observed failure",
"correctness: appends cleanly when no deploy steps exist — addressed, precheck is gated inside 'If code task' block and only triggers when workflow assigns mutations to operator"
]
}
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.
Why
work-on-task-assistantPhase 5 already extracts the deploy workflow and reports who runs the mutations. On 2026-08-16 that block fired correctly for a cluster TLS migration and said:…and the session then spent roughly 40 minutes handing back
make/kubectlcommand blocks for the owner to paste, until they interrupted:"As always" marks it as habitual, not a one-off.
The global
CLAUDE.mdrule Permission Mode Precheck already says to surface this at task start, and it did not help — a rule restating what an artifact should emit is a symptom patch. Phase 5 is the artifact loaded at exactly the right moment, and it was one line short of enforcing it.What
When the extracted workflow assigns cluster/deploy mutations to the operator (
make apply,make buca,kubectlwrites,helm install/upgrade, ssh deploys, prod runbook steps), Phase 5 now appends a verbatim line prompting theaccept editsswitch.The distinction the change rests on: the existing split describes who may run the command; the new line makes the switch that lets the agent actually run it in-session.
Scoped, not unconditional — non-ops tasks are unaffected.
Verification
make precommitpasses (formatting, mocking, tests, linting, vulnerability scans, CHANGELOG, license headers — 27.3s).Behavioural check belongs to the next ops-shaped
work-on-taskrun: the Development Workflow section should carry the 🔐 line, and a task with no operator-run deploy steps should not.