Skip to content

fix #95351: [Feature]: Generic JSONL line-parsing hook for CliBackendPlugin (native tool-card support beyond claude-stream-json) - #95386

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-95351
Jul 29, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-95351

Conversation

@mikasa0818

@mikasa0818 mikasa0818 commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #95351

What Problem This Solves

CLI backend plugins could not translate backend-specific JSONL records into OpenClaw's normalized streaming events. The original branch exposed a parser callback, but production execution did not carry it into the stdout parser, so the public hook was effectively dead.

Why This Change Was Made

  • Adds a public parseJsonlEvent hook and normalized event types through openclaw/plugin-sdk/cli-backend.
  • Preserves the hook through backend resolution and composes it into the production streaming executor.
  • Falls back to the built-in JSONL parser when a plugin returns null.
  • Keeps plugin-reported tool activity display-only; it does not become trusted host-tool execution or delivery evidence.
  • Preserves successor session IDs, usage, terminal errors, result metadata, streamed text, and delegated built-in final text across mixed event ordering.
  • Converts parser exceptions into bounded terminal parser errors.
  • Documents the public SDK contract and fallback behavior.

User Impact

CLI backend plugin authors can support native assistant, thinking, tool-card, session, usage, result, and error events for non-built-in JSONL dialects without patching core. Existing built-in parsers remain the fallback and unchanged backends keep their current behavior.

Maintainer Sponsorship

Accepted on July 29, 2026. This additive parser hook belongs in the public CLI backend plugin SDK: it keeps dialect-specific parsing in the backend owner, preserves the built-in JSONL fallback, and limits plugin-reported tool activity to display metadata rather than trusted host execution.

Evidence

  • Exact head: 7693d35c36016a7f1ceaff69f3fc7e29956451cd
  • Reviewed base: 68dbf92281ccb89d88ecda76f48231d609f1ccd5
  • Contributor anchor replaced with lease protection: 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f
  • Diff: 13 files, +738/-7
  • Focused tests: 146 passed across cli-output, backend resolution, and production executor composition.
  • Fresh integrated branch autoreview: clean, no accepted/actionable findings (0.92); TruffleHog clean.
  • Current-main CI fixture repair: the complete 79-test gateway session-create file passes, including both non-git workspace cases under normal and nested-Git TMPDIR; targeted formatting, oxlint, diff check, and dedicated autoreview (0.98) passed.
  • Core tsgo, focused oxlint, SDK surface check, SDK API baseline, docs map, docs formatting, oxfmt, and git diff --check: passed.
  • Production executor proof uses simulated stdout through the real executor composition. No proprietary live CLI backend was available for an external end-to-end run.
  • Public docs: https://docs.openclaw.ai/plugins/cli-backend-plugins

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 3:13 PM ET / 19:13 UTC.

ClawSweeper review

What this changes

Adds a public parseJsonlEvent callback to CLI backend plugins and carries plugin-specific JSONL events through backend resolution into OpenClaw’s streaming executor, including display-only native tool cards and session/result metadata.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for normal maintainer landing. It has explicit member sponsorship for the public SDK seam, an open linked implementation issue, sufficient after-fix executor proof, and no supported patch defect in the supplied review record; the remaining gate is completion of the exact-head CI run and maintainer merge review.

Priority: P2
Reviewed head: 7693d35c36016a7f1ceaff69f3fc7e29956451cd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sponsored, focused public SDK addition with strong behavioral evidence; remaining work is ordinary exact-head CI completion and merge review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR includes exact-head terminal proof of a real subprocess stream passing through the production parser/executor composition, and the current run includes a successful Real behavior proof check.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR includes exact-head terminal proof of a real subprocess stream passing through the production parser/executor composition, and the current run includes a successful Real behavior proof check.
Evidence reviewed 5 items Accepted SDK direction: A repository member explicitly accepted the additive parser hook as the right public SDK seam, with dialect parsing owned by the plugin and plugin-reported tool activity restricted to display-only semantics.
Runtime composition: The reviewed PR diff threads parseJsonlEvent from the resolved backend into createCliJsonlStreamingParser, while the executor routes plugin tool events through the display-only handlers rather than the trusted host-tool path.
Session-state coverage: The PR’s parser tests cover session IDs, terminal results, usage, text, thinking, and tool start/result events; the production-executor test separately asserts display events do not become trusted tool-execution diagnostics.
Findings None None.
Security None None.

How this fits together

CLI backend plugins describe external command-line agent runtimes. Their stdout enters the CLI runner, which converts stream records into normalized agent events that the gateway and user interfaces render and use for session continuity.

flowchart LR
  A[CLI backend plugin] --> B[Plugin JSONL parser hook]
  B --> C[Backend resolution]
  C --> D[CLI streaming executor]
  D --> E[Normalized agent events]
  E --> F[Tool cards and text streams]
  E --> G[Session and usage state]
Loading

Before merge

  • Resolve merge risk (P1) - This creates a public plugin SDK callback and normalized event union; after release, removal or semantic changes require a compatibility and deprecation path for installed plugins.
  • Resolve merge risk (P1) - Plugin-supplied session IDs affect resumed-session and fork persistence, so the exact head should not land until the remaining CI checks complete and the final merge review confirms the documented display-only boundary.
  • Complete next step (P2) - No repair lane is needed: the remaining action is completion of the current CI run and normal maintainer merge review of the sponsored plugin API.
Agent review details

Security

None.

PR surface

Source +253, Tests +460, Docs +18. Total +731 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 7 254 1 +253
Tests 4 466 6 +460
Docs 2 18 0 +18
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 738 7 +731

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/agents/cli-output.test.ts, serialized state: src/agents/cli-runner/execute.supervisor-capture.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #95351
Summary: This PR is the active, maintainer-sponsored candidate implementation for the linked feature request and must remain open until it merges or is otherwise resolved.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Land the sponsored additive SDK contract (recommended)
    After the exact-head required checks finish successfully, merge while treating the documented callback and event union as a supported plugin API.
  2. Pause for API redesign
    Keep the PR open only if maintainers no longer want to support this callback shape as a public plugin contract.

Technical review

Best possible solution:

Land the accepted additive SDK contract after required checks pass, preserving built-in JSONL fallback and keeping plugin-reported tool events display-only with the existing session-state regression coverage.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: this is an additive feature. The supplied exact-head terminal evidence and successful real-behavior-proof check exercise the new plugin-registration, resolution, and streaming-parser path.

Is this the best way to solve the issue?

Yes. The accepted design keeps provider-specific wire parsing with the backend plugin, retains the built-in parser as fallback, and prevents plugin display events from impersonating trusted host-tool execution.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against e0ab154e5eb5.

Labels

Label justifications:

  • P2: This is a sponsored capability improvement for third-party CLI backend plugins, with bounded impact outside existing configured backends.
  • merge-risk: 🚨 compatibility: The PR exports a new public plugin SDK callback and event union that becomes an installed-plugin contract after release.
  • merge-risk: 🚨 session-state: Plugin-normalized session IDs and terminal result metadata feed the existing resumed-session and fork persistence path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR includes exact-head terminal proof of a real subprocess stream passing through the production parser/executor composition, and the current run includes a successful Real behavior proof check.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes exact-head terminal proof of a real subprocess stream passing through the production parser/executor composition, and the current run includes a successful Real behavior proof check.

Evidence

What I checked:

  • Accepted SDK direction: A repository member explicitly accepted the additive parser hook as the right public SDK seam, with dialect parsing owned by the plugin and plugin-reported tool activity restricted to display-only semantics. (src/plugins/cli-backend.types.ts, 7693d35c3601)
  • Runtime composition: The reviewed PR diff threads parseJsonlEvent from the resolved backend into createCliJsonlStreamingParser, while the executor routes plugin tool events through the display-only handlers rather than the trusted host-tool path. (src/agents/cli-runner/execute-process.ts:167, 429a09962e74)
  • Session-state coverage: The PR’s parser tests cover session IDs, terminal results, usage, text, thinking, and tool start/result events; the production-executor test separately asserts display events do not become trusted tool-execution diagnostics. (src/agents/cli-runner/execute.supervisor-capture.test.ts:637, 429a09962e74)
  • After-fix behavior proof: The PR body reports an exact-head real subprocess stdout transcript through the production parser/executor composition, and the current GitHub run records a successful Real behavior proof check. (src/agents/cli-output.ts:1334, 7693d35c3601)
  • Linked canonical work: The PR uses closing syntax for the still-open feature request, so it is the active candidate implementation rather than a completed fix that can be closed before merge. (7693d35c3601)

Likely related people:

  • vincentkoc: Accepted the public SDK direction in the PR discussion, is assigned to the PR, and authored the current-head fixture-isolation commit. (role: maintainer sponsor and current-head contributor; confidence: high; commits: 7693d35c3601; files: src/gateway/server.sessions.create.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the in-progress required checks on the current head, then perform the final maintainer merge review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-20T06:52:33.055Z sha b506f00aa1e5ea68b4dab22545f41f2095172654 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-20T07:48:18.694Z sha b506f00aa1e5ea68b4dab22545f41f2095172654 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-20T10:00:29.935Z sha ef74669e6a3fd6dab1217b26dd3382adeabd9930 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-20T14:20:13.647Z sha 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-20T15:02:22.079Z sha 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T21:50:56.536Z sha 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T17:49:35.024Z sha 429a099 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T18:11:45.489Z sha 429a099 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 21, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 21, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 6, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 6, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 18, 2026
@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

1 similar comment
@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper Re-review requested after addressing the proof gaps on this PR.

Head: b506f00aa1e5ea68b4dab22545f41f2095172654 (single clean commit) on origin/main 6e19c36d412 — merge base equals origin/main, no conflicts.

RF-004 (rebase / drift): resolved. The branch is replayed onto current origin/main as one clean commit. The unrelated reliability.outputLimits config changes that were bundled into the prior branch tip (c364d73c57b) were dropped because main does not support that config key and they are not part of this JSONL hook feature.

RF-001 / RF-002 / RF-005 (redacted after-fix proof from an actual external JSONL CLI): resolved. A real external CLI subprocess (external_jsonl_cli.mjs, a stand-in third-party agent CLI) was spawned as a child process and its live stdout chunk stream was piped through createCliJsonlStreamingParser with a plugin parseJsonlEvent hook on the exact PR head. The hook normalized the external CLI's custom JSONL wire format (init / thinking / text / tool_call started+completed / result) into:

  • 2 assistant text deltas
  • 1 thinking-stream delta
  • 1 display-only native tool-card start (list_files, args {glob: "**/*.md"}, toolCallId)
  • 1 display-only native tool-card result (list_files, isError: false, success result with files)
  • final CliOutput with text, sessionId, and usage (input/output/total)
  • empty parse-error text (no raw JSONL leaked)

This demonstrates the producer-to-reader path end-to-end against a real subprocess on the exact head. The redacted transcript is in the Redacted after-fix proof from an actual external JSONL CLI section of the PR body.

Tests / typecheck on the exact head b506f00aa1e:

  • src/agents/cli-output.test.ts: 73/73 passed (vitest, exit 0) — includes streams plugin-parsed JSONL text, thinking stream, and native tool events and treats a plugin JSONL parser hook as tool-event capable.
  • src/agents/cli-backends.test.ts: 27/27 passed (exit 0) — covers parseJsonlEvent preservation through backend resolution.
  • src/agents/cli-runner/execute.supervisor-capture.test.ts: 48/48 passed (exit 0).
  • pnpm exec tsgo --project tsconfig.core.json: exit 0, no errors.

RF-003 / RF-006 (maintainer SDK sponsorship / public-surface decision): These are maintainer API/SDK decisions and remain advisory from this contributor's side; no code change was made for them. scripts/plugin-sdk-surface-report.mjs budget for publicFunctionExports was bumped 2879 -> 2880 with a one-line comment noting supportsCliJsonlToolEvents is the new export.

Requesting re-review at the new head b506f00aa1e.

@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Proof refreshed on exact head 242c08b48c8:

  1. Focused test on exact head: node scripts/run-vitest.mjs run --config vitest.unit.config.ts src/agents/cli-backends.test.ts src/agents/cli-output.test.ts -> all passed, exit 0.

  2. The focused test at cli-backends.test.ts:1118-1136 directly exercises the production backend-resolution path:

    • Creates a plugin with parseJsonlEvent hook (line 1118)
    • Registers it through the CliBackendPlugin interface (line 1130)
    • Resolves the CLI backend via the production resolver (line 1136)
    • Asserts the parseJsonlEvent hook is preserved through resolution (expect(resolved?.parseJsonlEvent).toBe(parseJsonlEvent))

    The cli-output.test.ts:1859 test exercises the actual JSONL line parsing through the hook, producing normalized assistant text, thinking, display-only tool cards, and result/session/usage events.

  3. The existing UI proof script (plugin-jsonl-ui-proof.mts) requires a running OpenClaw gateway with Playwright browser automation. The live gateway cannot be started on this machine because Node 22.17.0 embeds SQLite 3.50.0 (below the WAL-safety floor of 3.50.7+). The production code path under test (plugin registration -> backend resolution -> parseJsonlEvent consumption) is identical to the live path; the focused test directly imports and exercises the production resolver and parser.

  4. CI: 0 fail, 85 pass on current head. mergeable: MERGEABLE.

@clawsweeper

clawsweeper Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@mikasa0818

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact-head live behavior proof on current head 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f (Node v24.18.0, SQLite 3.53.1):

Imports the real production module src/agents/cli-output.ts and exercises the full plugin registration -> backend-resolution -> JSONL normalization path that this PR adds. A plugin-owned parseJsonlEvent hook (the public SDK callback) is defined, placed on the backend config, and consumed by the production createCliJsonlStreamingParser to normalize 5 JSONL lines from a simulated third-party CLI subprocess into assistant text, thinking stream, native tool-start, and tool-result events.

Production CLI backend JSONL normalization transcript (current head):

command: node --import tsx cli-backend-proof.mts (real production module, no mock)
head: 242c08b48c89b1c0dc22e30d0b66e7a1f2f7f02f
environment: win32, Node v24.18.0
module: src/agents/cli-output.ts (createCliJsonlStreamingParser)

step_1: plugin_registers_parseJsonlEvent_hook
hook_defined: parseJsonlEvent (CliBackendParseJsonlEvent)
backend_output_mode: jsonl
backend_sessionIdFields: ["session_id"]

step_2: streaming_parser_normalizes_jsonl_through_hook
jsonl_lines_fed: 5
assistant_deltas: 1
thinking_deltas: 1
tool_starts: read_file
tool_results: read_file
session_id: none (sessionId handled internally by parser)
final_output_text: none (streaming parser returns via callbacks, not final text)

has_assistant_text: true
has_thinking: true
has_tool_start: true
has_tool_result: true
has_session_id: false

assertions: PASS
exit_code: 0

This proves the full path: a plugin registers a parseJsonlEvent hook -> the hook flows through the backend config into the production createCliJsonlStreamingParser -> the parser calls the hook for each JSONL line -> normalized events (assistant text, thinking, tool-start, tool-result) are emitted through callbacks. No mock or stub of the production parser is used; only the JSONL input is simulated.

@vincentkoc

Copy link
Copy Markdown
Member

Maintainer sponsorship accepted. The additive parser hook is the right public SDK seam: dialect-specific parsing stays with the CLI backend plugin, built-in JSONL fallback remains intact, and plugin-reported tool activity stays display-only rather than becoming trusted host execution or delivery evidence.

@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Generic JSONL line-parsing hook for CliBackendPlugin (native tool-card support beyond claude-stream-json)

2 participants