Repository navigation
feat(agents): concise + guided A/B/C interaction overlay for Claude (ENG-16418) - #70
Conversation
…ENG-16418) Claude models received no interaction-style guidance: the core prompt's interaction_style section is empty by default and only OpenAI/OpenRouter/Codex supplied overlays (gated on GPT-5 ids). Boon runs Claude via an Anthropic-API gateway (provider id 'anthropic'), so its agent got zero conciseness/verbosity guidance. Add a provider-agnostic concise overlay (lead with the answer, avoid walls of text, offer a short A/B/C guided choice instead of elaborating every branch) and wire it through the anthropic provider's resolveSystemPromptContribution hook, gated on Claude model ids and a new agents.defaults.promptOverlays.claude personality toggle (concise|on|off, default concise). Verified end-to-end against Bedrock Opus 4.8 through the gateway: the overlay appears in the live system prompt and the agent replies concisely with an A/B/C narrowing prompt. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
cubic analysis
No issues found across 11 files
Linked issue analysis
Linked issue: ENG-16418: [Arguijo] Reduce Boon Agent verbosity + guided Q&A (A/B/C narrowing)
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Agent default responses are materially shorter / less verbose in customer chats. | The PR adds a provider-agnostic concise interaction overlay and wires it for Claude model ids; unit tests assert the concise overlay is present and the PR includes live end-to-end evidence showing concise, answer-first replies. |
| ✅ | Where a response could branch, the agent offers a short guided-choice prompt (A/B/C style) instead of elaborating on all branches. | The overlay text explicitly instructs offering an A/B/C-style guided choice and tests/checks verify the 'A, B, or C' guidance is included; live e2e showed an explicit A/B/C guided choice. |
| Message-splitting in Teams channels is eliminated or minimized. | The PR reduces verbosity (which should help message-splitting) but explicitly states Teams message-splitting is driven by block-streaming config and is handled in a separate ticket (ENG-16469); this change reduces but does not eliminate the problem. | |
| Verbosity reduction is measurable (e.g. avg response length / tokens per response down vs baseline). | The PR provides anecdotal live-e2e evidence of a shorter reply and notes token-efficiency as a goal, but it does not include a before-vs-after quantitative comparison or automated metric run against a fixed prompt set. | |
| ❌ | Coordination confirmed with Victor to avoid duplicate work. | The linked issue flags Victor may be tackling this; the PR does not include an explicit confirmation of coordination or a changelog/issue comment confirming alignment. |
…ts (ENG-16418) The concise-interaction-overlay barrel re-exports (3) plus the ClaudePromptOverlayConfig config type (1, in the deprecated config-types entrypoint) grow the public SDK surface past the ratcheted budgets in plugin-sdk-surface-report. Bump publicExports 10377->10381, publicFunctionExports 5206->5208, publicDeprecatedExports 3247->3248, and config-types deprecated 416->417 to match the new counts. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Approved — clean, well-scoped implementation of ENG-16418 (AC1 concise default + AC2 A/B/C guided narrowing).
Architecture: Mirrors the existing GPT-5 overlay seam exactly — new provider-agnostic concise-interaction-overlay.ts in src/agents/, Anthropic-specific wiring in extensions/anthropic/ via resolveSystemPromptContribution, new promptOverlays.claude.personality config sibling to gpt5. Reuses the shared contribution rather than duplicating; additive + backward-compatible; .strict() zod; SDK surface budgets bumped to match the new exports (correct, not a workaround). Root-cause writeup (empty core interaction_style + GPT-5-only overlay gating) is accurate.
Tests: 7 unit tests cover Claude-id gating, non-Claude undefined, off suppression, and A/B/C guidance presence. Plus a live E2E against Bedrock Opus through the gateway confirming the overlay lands in the real system prompt. Good.
No blockers: no secrets in diff/history, no migrations, no breaking changes, no reused-code that should've been shared.
Non-blocking notes (correctly scoped out, tracked):
- AC3 (Teams message-splitting) is honestly deferred to ENG-16469 — right call, it's block-streaming config, not model output.
- AC4 (measurable token/length delta vs baseline) isn't captured as a before/after number here; worth a quick measured comparison on a fixed prompt set to close the ticket's own test plan.
- The
@sentry/opentelemetrynode_modules breakage noted in the description is pre-existing/unrelated — good follow-up flag.
Ship it.
Bump gateway + @openclaw/slack + @openclaw/msteams to 2026.6.11-boon.7 in lockstep (package.json + npm-shrinkwrap.json roots) and add the CHANGELOG entry. Ships the boon.7 train: #70 (ENG-16418 concise + A/B/C overlay for Claude), #68 (ENG-16200 progress nudges runtime, gated off by default), #69 (security dep bumps), #64 (ENG-16330 non-terminal recovered-tool-error badge). Base = 2026.6.11-boon.6. Only slack + msteams carry the -boon.N suffix; other extensions stay at plain 2026.6.11 (fork release does not run a blanket plugins:sync). Formatting proof: oxfmt --check clean on CHANGELOG.md; the six JSON files are oxfmt-excluded lockfile-class and byte-shape-identical to the boon.6 release commit. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
What Problem This Solves
The Boon agent is too verbose in customer chats (long, memo-style walls of text) and never steers users with a tight "want me to go deeper on A, B, or C?" choice. This costs tokens and degrades the Teams experience for Arguijo (ENG-16418).
Root cause is architectural: the core system prompt's
interaction_stylesection is empty by default — conciseness/tone guidance only reaches the model through a provider system-prompt contribution, and today only OpenAI/OpenRouter/Codex supply one (gated on GPT-5 model ids). Boon runs Claude through an Anthropic-API-compatible gateway (runtime provider idanthropic), soisGpt5ModelIdis false and the deployed agent received zero interaction-style/verbosity guidance.Why This Change Was Made
Give Claude-family sessions a concise, guided-choice interaction style through the same provider-contribution seam OpenAI already uses — systematic, in-code, and cache-aware — so default replies are materially shorter and branchy answers offer a plain-text A/B/C choice instead of elaborating every option up front.
src/agents/concise-interaction-overlay.ts: a## Interaction Stylesection (lead with the answer, shortest reply that fully answers, offer a short "A/B/C" guided choice when a request branches) plus a small<output_contract>behavior contract. Exported viaopenclaw/plugin-sdk/provider-model-shared.resolveSystemPromptContributionhook (extensions/anthropic/prompt-overlay.ts+register.runtime.ts), gated on Claude model ids (resolveClaudeModelIdentity(...).startsWith("claude-")) and a new config toggle.agents.defaults.promptOverlays.claude.personality(concise|on|off, defaultconcise), mirroring the existinggpt5sibling — additive, backward-compatible, defaults on.Scope is ENG-16418 only. Teams message-splitting (ENG-16469) is a separate parked ticket driven by block-streaming config, not model output; shorter replies from this change reduce but do not fix it.
User Impact
Claude-backed Boon agents now default to concise, answer-first replies and offer A/B/C narrowing on branchy questions instead of dumping walls of text. Behavior is on by default and can be disabled per-deployment with
agents.defaults.promptOverlays.claude.personality: "off". No config migration required (additive optional field).Evidence
src/agents/concise-interaction-overlay.test.ts(4) +extensions/anthropic/prompt-overlay.test.ts(3) — all pass. Cover: Claude-id gating, A/B/C guidance presence,offsuppression, non-Claude returns undefined.pnpm tsgo:coreandpnpm tsgo:extensionsboth exit 0.docs/.generated/plugin-sdk-api-baseline.sha256).anthropic, Teams session key):## Interaction Style, theA, B, or Cline, andDefault to concise, dense repliesin the captured/v1/messagesrequest.Note: a pre-existing, unrelated dependency breakage (
@sentry/opentelemetry→TracesSamplerValuesundefined) exists in the repo's current node_modules on both this worktree andmain; it blocks the sentry-monitor plugin at CLI startup. Worked around for the live test only (not part of this diff). Worth a separate follow-up.🤖 Generated with Claude Code
Summary by cubic
Make Claude-backed Boon agents concise by default and add a short A/B/C guided narrowing prompt to reduce walls of text. This aligns with ENG-16418 by delivering shorter answers and guided choices on branchy questions.
New Features
<output_contract>(src/agents/concise-interaction-overlay.ts), exported viaopenclaw/plugin-sdk/provider-model-shared; raised SDK surface budgets to account for the new exports.resolveSystemPromptContribution, gated to Claude model ids and config (extensions/anthropic/prompt-overlay.ts).agents.defaults.promptOverlays.claude.personality(concise|on|off, defaultconcise).Migration
agents.defaults.promptOverlays.claude.personality: "off".Written for commit 0e45af8. Summary will update on new commits.