Skip to content

In-agent UX hook side: quiet turns, session receipt, /acp-approve, approval-landed context (0.28.0) - #48

Draft
davidcrowe wants to merge 1 commit into
mainfrom
feat/in-agent-ux-1346
Draft

davidcrowe wants to merge 1 commit into
mainfrom
feat/in-agent-ux-1346

Conversation

@davidcrowe

Copy link
Copy Markdown
Collaborator

Hook side of davidcrowe/gatewaystack-connect#1346–#1352 (0.28.0). Do not merge or publish yet: dogfooding locally via --plugin-dir against the internal-only in_agent_ux rollout; review after a few days of live data.

  • Stop prints a turn line only when the turn held, flagged or got a notice, and keeps listing held calls until they resolve; SessionEnd prints the real totals receipt.
  • UserPromptSubmit: when a held call from this session was approved, tells the model to retry it (additionalContext on Claude Code, systemMessage on Codex/Copilot).
  • /acp-approve [code]: this session's held calls with code, age and a workspace-pinned link. Approves nothing.
  • agent_notice reaches the model; notice stays human-facing.
  • SessionStart shows catch_up and upgrade_notice to the human; upgrade at most once per 24h, and the old model-facing upgrade text is dropped when the new one is present.
  • One UNGOVERNED line per outage, plus a recovery line with the unchecked count.

Tests: 305/305. retry-before-fail-closed.test.mjs reports a file-level timeout on origin/main too.

…notices

- Stop now prints a per-turn line only when the turn held a call, flagged,
  or got a shadow/cost notice, plus a reminder for still-pending approvals;
  cumulative counters move to SessionEnd (new event) and no longer clear
  on every Stop, so a multi-turn session's receipt isn't just the last turn.
- UserPromptSubmit polls GET /plugin/intents/approvals (<=1.5s, silent on
  failure) for this session's pending held calls and surfaces newly
  approved ones as a model-facing retry line (additionalContext on Claude
  Code, systemMessage fallback on Codex/Copilot); skipped entirely for
  subagents and when nothing is pending.
- New /acp-approve command (UserPromptExpansion) lists or filters this
  session's pending held calls from local state, same pattern as
  /acp-status.
- agent_notice on PostToolUse now reaches the model via additionalContext
  on Claude Code, with a systemMessage fallback on harnesses that only
  honor additionalContext at SessionStart.
- SessionStart surfaces catch_up and upgrade_notice (capped once per 24h)
  as human-facing systemMessage; upgrade_notice supersedes the older
  model-facing notice field per contract instead of double-emitting it.
- UNGOVERNED banner during a gateway outage now fires once at the start
  of the outage and once more (with a call count) on recovery, instead of
  repeating on every call in between.
- Bump plugin version to 0.28.0; wire SessionEnd and UserPromptSubmit into
  hooks.json.

Tests: three new files (turn-and-session-receipt, approvals-and-notices,
notices-and-outage) covering the above; full suite passes (305 tests).
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