Skip to content

fix(agents): recognize the claude-cli-* family in the stream-json dialect gate#80

Merged
LightDriverCS merged 1 commit into
mainfrom
fix/cli-output-claude-cli-family-match
Jun 21, 2026
Merged

fix(agents): recognize the claude-cli-* family in the stream-json dialect gate#80
LightDriverCS merged 1 commit into
mainfrom
fix/cli-output-claude-cli-family-match

Conversation

@LightDriverCS

Copy link
Copy Markdown

What

Widen isClaudeCliProvider (src/agents/cli-output.ts) from an exact === "claude-cli" match to the claude-cli-* family, so the ultracode backend (claude-cli-ultracode) passes the stream-json dialect gate.

Why

The ultracode variant resolves to provider/backend id claude-cli-ultracode and never sets jsonlDialect. With the exact match, usesClaudeStreamJsonDialect returned false for it, so createCliJsonlStreamingParser silently dropped:

  • native text deltas → assistant text fell back to the raw stream-json blob (the "C1" raw-stream leak in the Aurelius console); and
  • tool eventsAskUserQuestion never reached onToolUseStart, so ask_choice choice-cards never fired.

Both downstream consumers — usesClaudeStreamJsonDialect and shouldUnwrapNestedCliResultText — route through this one helper, so widening it restores text streaming, result unwrap, and tool dispatch for ultracode in a single change.

Scope — read before extending

Deliberately limited to this one gate. There are ~20 other === "claude-cli" sites in the gateway and some are load-bearing — e.g. claude-live-session.ts exact-matches to keep ultracode on the one-shot JSONL path; family-matching it would reintroduce the C1 leak. Those are tracked in a separate per-site audit (one-vault handoffs/gateway-ultracode-family-match-audit-2026-06-20.md), not here.

Handoff (Anvil)

  • Touched surfaces: src/agents/cli-output.ts (1 helper, +9/−1) and src/agents/cli-output.test.ts (+96, 2 regression tests). No other files.
  • Firebase / deploy impact: none — pure gateway output-parsing logic; no schema, config, or infra change.
  • Local gates: cli-output.test.ts 34/34 pass (vitest, incl. the 2 new claude-cli-ultracode cases); pre-commit lint hook passed on both files. Full-repo typecheck/lint left to CI.
  • Smoke evidence: the byte-identical change is verified live on the mbp gateway (2026-06-20 — ultracode console turns render clean text + populated Context%, and choice prompts render cards) and deployed to the mini1 failover gateway for parity (runbook console-v2-mini1-deploy-2026-06-20.md).
  • Blockers: none.
  • Follow-ups: (1) after merge — tag a release and bump BenchAGI/homebrew-tap/Formula/openclaw.rb so customers on ultracode receive the fix; (2) the separate ~20-site family-match audit.

Kept draft for Anvil per the PR-readiness contract.

🤖 Generated with Claude Code

…lect gate

`isClaudeCliProvider` exact-matched "claude-cli", but the ultracode variant
resolves to backend/provider id "claude-cli-ultracode" (and future variants may
follow the same "claude-cli-<flavor>" convention). It speaks the same Claude CLI
stream-json dialect, yet failed the gate — so `usesClaudeStreamJsonDialect` was
false and the JSONL parser silently dropped native text deltas, result frames,
and tool events: AskUserQuestion never reached onToolUseStart (no ask_choice
card), and assistant text fell back to the raw stream-json blob (the C1 leak).

Widen the gate to the claude-cli-* family. Both downstream callers
(usesClaudeStreamJsonDialect, shouldUnwrapNestedCliResultText) route through this
one helper, so the single change restores text streaming, result unwrap, and
tool dispatch for ultracode. Deliberately scoped to this gate only — other
`=== "claude-cli"` sites are load-bearing (e.g. claude-live-session keeps
ultracode on the one-shot JSONL path) and are tracked in a separate audit.

Adds 2 regression tests for the claude-cli-ultracode backend (tool-event
dispatch + native text deltas). cli-output.test.ts: 34/34 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@LightDriverCS
LightDriverCS marked this pull request as ready for review June 21, 2026 02:14
@LightDriverCS
LightDriverCS merged commit 40204ac into main Jun 21, 2026
193 of 194 checks passed
@LightDriverCS
LightDriverCS deleted the fix/cli-output-claude-cli-family-match branch June 21, 2026 02:22
LightDriverCS added a commit to BenchAGI/homebrew-tap that referenced this pull request Jun 21, 2026
)

Bump the openclaw formula bench.1 -> bench.2 so `brew upgrade benchagi/tap/openclaw`
ships the ultracode stream-json dialect fix (BenchAGI/openclaw#80, merged to main
@40204ac13a). url -> v2026.6.8-bench.2 tag tarball; sha256 -> 85301c98...
(independently re-verified from the pushed tag tarball).

Co-authored-by: Cory Shelton <[email protected]>
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.

2 participants