Skip to content

feat(agents): concise + guided A/B/C interaction overlay for Claude (ENG-16418) - #70

Merged
convyusboy merged 2 commits into
boonfrom
ridho/eng-16418-arguijo-reduce-boon-agent-verbosity-guided-qa-abc-narrowing
Jul 23, 2026
Merged

convyusboy merged 2 commits into
boonfrom
ridho/eng-16418-arguijo-reduce-boon-agent-verbosity-guided-qa-abc-narrowing

Conversation

@convyusboy

@convyusboy convyusboy commented Jul 23, 2026 •

Copy link
Copy Markdown
Collaborator

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_style section 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 id anthropic), so isGpt5ModelId is 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.

  • New provider-agnostic overlay src/agents/concise-interaction-overlay.ts: a ## Interaction Style section (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 via openclaw/plugin-sdk/provider-model-shared.
  • Wired through the anthropic provider's resolveSystemPromptContribution hook (extensions/anthropic/prompt-overlay.ts + register.runtime.ts), gated on Claude model ids (resolveClaudeModelIdentity(...).startsWith("claude-")) and a new config toggle.
  • New config toggle agents.defaults.promptOverlays.claude.personality (concise | on | off, default concise), mirroring the existing gpt5 sibling — 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

  • Unit tests (Vitest): 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, off suppression, non-Claude returns undefined.
  • Typecheck: pnpm tsgo:core and pnpm tsgo:extensions both exit 0.
  • Plugin SDK API baseline regenerated (docs/.generated/plugin-sdk-api-baseline.sha256).
  • Live end-to-end against Bedrock Opus 4.8 through the Boon LLM gateway (provider id anthropic, Teams session key):
    • The overlay appears in the real system prompt sent upstream — verified ## Interaction Style, the A, B, or C line, and Default to concise, dense replies in the captured /v1/messages request.
    • On a branchy prompt the agent replied concisely (~1500 chars, answer-first) and closed with an explicit A/B/C guided choice rather than elaborating all branches.
  • Code review: 4-agent quality pass applied (collapsed a redundant dual-gate to one boolean, kept overlay text off the public SDK surface, corrected help text that over-promised Bedrock/litellm coverage).

Note: a pre-existing, unrelated dependency breakage (@sentry/opentelemetry → TracesSamplerValues undefined) exists in the repo's current node_modules on both this worktree and main; 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

    • Added a provider-agnostic concise overlay with a clear Interaction Style and <output_contract> (src/agents/concise-interaction-overlay.ts), exported via openclaw/plugin-sdk/provider-model-shared; raised SDK surface budgets to account for the new exports.
    • Wired into the Anthropic provider via resolveSystemPromptContribution, gated to Claude model ids and config (extensions/anthropic/prompt-overlay.ts).
    • New config: agents.defaults.promptOverlays.claude.personality (concise | on | off, default concise).
  • Migration

    • No changes required. To disable for Claude models, set agents.defaults.promptOverlays.claude.personality: "off".

Written for commit 0e45af8. Summary will update on new commits.

Review in cubic

…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

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Re-trigger cubic

…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]>

@gandalfboon gandalfboon Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/opentelemetry node_modules breakage noted in the description is pre-existing/unrelated — good follow-up flag.

Ship it.

@convyusboy
convyusboy merged commit a367302 into boon Jul 23, 2026
145 checks passed
@convyusboy
convyusboy deleted the ridho/eng-16418-arguijo-reduce-boon-agent-verbosity-guided-qa-abc-narrowing branch July 23, 2026 13:41
convyusboy added a commit that referenced this pull request Jul 23, 2026
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]>
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