Repository navigation
M7: abstain escalation — EscalatingPolicy + CommandEscalation - #67
Merged
Merged
Conversation
This was referenced Oct 17, 2026
Owner
Author
|
GATE-E: PASS (live, 2026-10-19) — A3 |
codeitlikemiley
force-pushed
the
instinct/m6-run-goal
branch
from
October 17, 2026 19:01
4a39e48 to
f3633fa
Compare
`gpui-agent run --goal … --escalate-cmd <program> [args…]` runs the
local Instinct policy first and calls the endpoint only on Abstain,
over the closed JSON stdin/stdout wire (PRD M7.2):
- choose requests carry goal/clause/offered actions/history and the
abstain reason + ranked candidates; text requests carry the field.
- Replies are exactly {"choice":{"id","op"}} | {"text":"…"} |
{"abstain":"…"} — off-menu ids, mismatched ops, extra fields,
non-JSON, over-64KiB or timed-out output are protocol violations
mapped to Blocked (hard error; nothing executes).
- Dangerous offers still land on needs_confirmation; endpoint picks
carry confidence_millis 0 in the receipt.
- Text tier: deterministic resolver first, command only on Missing;
password fields are never escalated.
- 30 s timeout (flag-overridable), endpoint spawned fresh per request,
writer/reader off-thread so stalls cannot deadlock the cap.
- bench/escalate_claude.py implements the wire on Haiku 5.5 with a
usage side-file under GPUI_AGENT_BENCH_DIR; the harness exports it.
21 tests: 14 policy unit (reply validation, short-circuit,
fallback-once, no-fallback, dangerous) + 7 CLI integration over a
scripted endpoint (choice dispatches, off-menu→blocked,
timeout→blocked, abstain stays abstain, no call on local choice,
kind:"text" fills Missing). A2 unchanged at 16/16. GATE-E remains
blocked on ANTHROPIC_API_KEY.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
codeitlikemiley
force-pushed
the
instinct/m7-escalate
branch
from
October 17, 2026 19:01
c09633d to
ca18792
Compare
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.
Summary
M7: optional escalation after the local Instinct policy abstains —
gpui-agent run --goal … --escalate-cmd <program> [args…](PRD M7,issue #58). Stacked on #66.
EscalatingPolicy<L,H>(port ofaui-policy/src/escalate.rs): localdecide first; fallback runs only on
Abstain. No re-scoring, no"top candidate wins", fallback abstain stays abstain.
CommandEscalation: one spawned endpoint per request over the closedJSON wire —
choose{v,kind,goal,clause,actions,history,abstain}and
text{v,kind,goal,clause,field}. Replies strictly{"choice":{"id","op"}}|{"text":"…"}|{"abstain":"…"}.Blocked: off-menu id/op, extra fields, non-JSON,needs_confirmation; escalated picksshow
confidence_millis 0.kind:"text"tier: deterministic resolver first, command only onMissing; password-role/named fields never escalated; ≤256 chars,single line.
bench/escalate_claude.pyupdated to the wire (Haiku 5.5, usageside-file
escalate_usage.jsonlunderGPUI_AGENT_BENCH_DIR); A3arm in
bench/arms.tomldrives it viapython3.Test plan
escalateunit tests (reply validation, dangerous →needs_confirmation, short-circuit / fallback-once / no-fallback)
run_escalateintegration tests (scripted endpoint: menuchoice dispatches, off-menu → blocked, timeout → blocked,
abstain stays abstain, endpoint never called on local choice,
kind:"text"fills Missing)ANTHROPIC_API_KEYunset; recorded as blocked in RESULTS.md
Generated with Devin