Skip to content

fix(channels): bundled channels reject the documented responsePrefix override - #118148

Merged
steipete merged 14 commits into
openclaw:mainfrom
ayaangazali:fix/response-prefix-schema-parity
Aug 27, 2026
Merged

steipete merged 14 commits into
openclaw:mainfrom
ayaangazali:fix/response-prefix-schema-parity

Conversation

@ayaangazali

@ayaangazali ayaangazali commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #112392, #117206.

What Problem This Solves

Fixes an issue where operators configuring documented response prefixes would have configuration rejected or replies silently use the global prefix instead of the channel/account override.

Improve @ayaangazali's response-prefix repair so accepted channel/account configuration reaches the canonical reply owner. This retains the contributor's commits and adds shared-owner repairs, behavioral regressions, generated metadata, and scoped documentation; it does not merely add fields to channels with no automatic-reply consumer.

The original defects crossed two boundaries: strict schemas rejected already-consumed settings, while some reply paths omitted channel/account or selected-model context. Schema-only parity could therefore produce valid configuration that was silently ignored.

Why This Change Was Made

  • Admit responsePrefix for Buzz and QA, retain ClickClack/Feishu/Twitch parity, and align exported types, Buzz manifest/catalog, generated metadata, and config baselines.
  • Route Tlon through its existing shared reply pipeline, deleting the separate global-only lookup while preserving human delay, native delivery, and the model signature.
  • Consolidate Feishu's prefix, typing, and selected-model context so text delivery and card footers share one owner; do not activate an additional payload transform.
  • Apply the shared prefix owner to ClickClack direct-model replies using the completion's actual model metadata.
  • Add Buzz, ClickClack, and QA to the canonical Doctor migration and scope the docs to actual automatic-reply support. Explicit text sends retain their existing shared prefix behavior.

No new dependency, plugin SDK API, protocol version, persistence schema, or media setting. Semantic comparison of generated metadata shows exactly eight added string-valued prefix paths and no unrelated schema change.

User Impact

Operators can use literal, identity, and selected-model prefixes on supported reply paths, with account overrides and explicit empty values respected. Existing global fallback and explicit-send prefix behavior remain intact; channels without automatic prefix consumers are not given inert configuration fields.

Release-note context: Channel response prefixes: honor channel/account overrides and selected-model prefixes across Buzz, ClickClack, Feishu, QA, Tlon, and Twitch, with schema and Doctor migration parity. Thanks @ayaangazali. The release-owned changelog is intentionally not edited in this PR.

Production: +112/-83 (net +29). Tests: +436/-37. Generated: +23/-23. Production growth adds the previously missing direct-model delivery capability and schema/migration fields; duplicated Tlon and Feishu policy was removed instead of adding parallel resolution paths.

Evidence

Regression and native-output evidence

These instrumented native-output regressions use actual shared prefix/dispatch code and mocked native send boundaries. They are not real Feishu, ClickClack, Tlon, or Twitch service runs, full Gateway runs, or durable-queue/authentication proof.

Surface Before After observed at native send boundary
Tlon Five channel/account/empty/identity/model cases delivered the global prefix All six cases pass with routed policy and the existing signature suffix
Feishu Five contextual-prefix cases delivered the global prefix Account/root/empty/identity/model text is correct; card notes retain the selected-model context
ClickClack direct model Missing shared prefix delivery Literal/account/empty/identity/selected-model outputs are correct; an existing prefix is not duplicated
Twitch Exact pre-fix schema rejects three multi-account cases; single-account control succeeds Both root forms, account override, and explicit empty override each reach exactly one native send with expected text

Buzz strict-schema regressions and Doctor migration regressions also failed before the repair. The refreshed focused sweep passed 350 tests; the final native-output test delta passed 28 tests, extension test types, and type-aware lint. Existing explicit-send owner tests passed 14 tests. The full changed-path guard/type/lint suite and canonical private-QA build passed on runtime commit c527ff0fab0469273d0e68e3d712f7342f18b0b3.

Actual Buzz Gateway evidence

An isolated built Gateway was connected to the official unmodified self-hosted upstream Buzz service, image ghcr.io/block/buzz@sha256:f900d24af243728eff73d0a96de2196138a01578bd45093a8fa3692eedecbff7, revision 4f554b6385065b698db819498a6f359b17a45459. It used dedicated task identities/room and deterministic mock-openai model gpt-5.6-luna. This is actual authenticated service and Gateway delivery, not a mock relay, hosted-service, clean-machine, live model-provider, or graphical-client proof.

Canonical QA passed both channel canary and mention gating. The owner matrix then read back 14 unique, validly signed events: five human inputs and nine exact bot outputs. All room and thread checks passed, including an automatic response inside an existing thread and two separate block outputs.

{
  "runtimeCommit": "c527ff0fab0469273d0e68e3d712f7342f18b0b3",
  "sourceBlind": false,
  "canonicalQa": { "passed": 2, "failed": 0 },
  "signedUniqueEvents": 14,
  "humanInputs": 5,
  "botOutputs": 9,
  "observed": {
    "literal": "[Prefix QA] <marker>",
    "auto": "[Prefix QA Bot] <marker>",
    "emptyOverGlobal": "<marker>",
    "selectedModel": "[gpt-5.6-luna] <marker>",
    "firstBlock": "[Stream QA] <first-marker>",
    "finalBlock": "[Stream QA] <final-marker>",
    "explicitLiteral": "[Stream QA] <plain-input-marker>",
    "explicitAlreadyPrefixed": "[Stream QA] <already-prefixed-input-marker>",
    "explicitUnresolvedProviderModel": "<plain-input-marker>"
  },
  "exactlyOnceAndThreadChecks": "pass",
  "gatewayShutdownExit": 0
}

The initial expectation that explicit CLI sends bypass prefixes failed. Reading the shared outbound owner and stable v2026.7.1 established that resolved explicit-send prefixes are already shipped behavior. The failed expectation was retained; the docs and behavior contract were corrected, not the runtime policy. Additional actual sends proved no double-prefixing and no unresolved provider/model placeholder leakage.

A fresh source-blind validator independently passed all six contract clauses with new markers, reading back 14 event envelopes and nine expected bot outputs, including existing-thread checks for both identity and block replies. It inspected no source, tests, diffs, or earlier verdicts, and confirmed clean shutdown and absence of its controller process. Its build identity was handoff-attested; the maintainer independently checked the build metadata. The validator did not separately reimplement signature verification. This pass used the same pinned service and pre-merge runtime described above.

The first canonical QA attempt stopped before Gateway startup because outer auth-profile staging consulted operator state and refused an incompatible schema version. The successful rerun isolated both outer CLI and child Gateway state explicitly; no migration or compatibility bypass was used. This outer-staging isolation gap is recorded as a separate follow-up.

Review follow-through

The latest ClawSweeper findings and Rank-up moves are addressed: Tlon's contextual delivery is repaired, ClickClack is included in Doctor migration, generic automatic support is scoped accurately, and after-fix native-output traces cover ClickClack/Feishu/Twitch. The generated config snapshot is not a SQLite or vector-store schema change. Fresh structured review and distinct independent code review found no actionable P0–P2 findings; the final test and documentation deltas were reviewed separately.

The necessary merge of current main preserves its core channel-schema repair and durable Tlon invite handling. Both complete Tlon test blocks are retained without edits; canonical regeneration adds eight schema-branch fields but seven unique doc paths because Twitch's root path already exists in its single-account form. Main's core/plugin baseline counts and hashes are unchanged. Post-integration focused tests passed 321 tests across seven files, including the durable-invite and prefix cases in their combined execution order. These local integration tests retained the existing installed dependencies to avoid disrupting other active validation; hosted CI subsequently passed with the declared lockfile. The pre-merge live run is not described as a newly rebuilt post-merge runtime.

Candidate: 7f64cdc5b4ec7cbacc87e9974acc4fcddda5bc10, including the necessary merge of main 25a16dd96c42876cc80b0ad754a612a75524b4eb. Source coverage is the earlier complete prefix review plus the fresh three-pass bounded integration review; it is not a claim of a newly rebuilt post-merge live environment. Exact-head CI passed, including all 65 changed-plugin test shards and openclaw/ci-gate. Native prepare/merge are still pending. This is not a merge-completion claim.

Copilot AI review requested due to automatic review settings August 2, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: nostr Channel integration: nostr channel: feishu Channel integration: feishu channel: qa-channel Channel integration: qa-channel channel: sms Channel integration: sms channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: buzz size: S labels Aug 2, 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. P2 Normal backlog priority with limited blast radius. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:43 PM ET / 23:43 UTC.

ClawSweeper review

What this changes

Adds response-prefix schema, migration, documentation, and reply-delivery support for Buzz, ClickClack, Feishu, QA Channel, Tlon, and Twitch.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: current main still rejects documented response-prefix settings for ClickClack, Feishu, and Twitch’s multi-account root form. The repair follows the shared reply-pipeline owner and has no supported blocking defect; exact-head CI remains the merge gate.

Priority: P2
Reviewed head: 7f64cdc5b4ec7cbacc87e9974acc4fcddda5bc10

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch uses existing ownership seams, includes focused regressions, and supplies a real after-fix transport trace.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.
Evidence reviewed 7 items Current-main schema gap: Current main's ClickClack schema has no responsePrefix property, while the PR adds it beside existing account settings.
Current-main Feishu and Twitch gaps: Current main omits responsePrefix from Feishu's shared schema and from Twitch's closed shared union base; the PR adds both fields.
Shared owner usage: ClickClack direct-model replies construct the public shared reply pipeline with channel, account, and selected-model context before delivery.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw config get --help

Result: PASS (completed)

$ node scripts/run-node.mjs config get --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 109.24 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 13.3s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 3922ms (slowest: built plugin control-plane loads 3278ms)

OpenClaw 2026.8.1 (7f64cdc) — All your chats, one OpenClaw.

Usage: openclaw config get [options] ‹path›

Get a config value by dot path

Arguments:
  path        Config path (dot or bracket notation)

Options:
  -h, --help  Display help for command
  --json      Output JSON (default: false)
$ node scripts/run-node.mjs config get --help

OpenClaw 2026.8.1 (7f64cdc) — All your chats, one OpenClaw.

Usage: openclaw config get [options] ‹path›

Get a config value by dot path

Arguments:
  path        Config path (dot or bracket notation)

Options:
  -h, --help  Display help for command
  --json      Output JSON (default: false)

Assertions:

  • PASS expect_output: Usage:

How this fits together

Channel configuration is validated before the Gateway accepts it, then inbound channel turns use the shared reply pipeline before native delivery. The change makes documented channel and account prefix settings survive validation and reach that pipeline.

flowchart LR
A[Operator configuration] --> B[Channel schemas]
B --> C[Gateway channel turn]
C --> D[Shared reply prefix pipeline]
D --> E[Native channel delivery]
F[Doctor migration] --> B
Loading

Before merge

  • Resolve merge risk (P1) - Doctor now copies an existing global prefix into newly supported channel blocks; this is an intentional upgrade-sensitive behavior and should be covered by the exact-head checks before merge.
  • Resolve merge risk (P1) - The current-head check suite is queued, so full integration validation is not yet complete.
  • Complete next step (P2) - This active contributor PR needs routine exact-head CI and maintainer review, not an automated repair job.
Agent review details

Security

None.

PR surface

Source +29, Tests +399, Docs +19, Generated 0, Other 0. Total +447 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 12 112 83 +29
Tests 7 436 37 +399
Docs 5 40 21 +19
Config 0 0 0 0
Generated 3 22 22 0
Other 1 1 1 0
Total 28 611 164 +447

Review metrics

Metric Value Why it matters
Response-prefix config surface 8 added schema paths The PR body identifies eight new string-valued generated-metadata paths, so config and upgrade behavior merit explicit review.
Production versus test delta production +112/-83; tests +436/-37; generated +23/-23 The stated production growth implements direct-model prefix delivery and migration ownership while removing duplicate Tlon and Feishu policy.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/concepts/messages.md, migration/backfill/repair: src/commands/doctor/shared/legacy-config-migrations.runtime.retired.test.ts, persistent cache schema: extensions/buzz/src/config-schema.test.ts, persistent cache schema: src/plugins/contracts/channel-response-prefix.contract.test.ts, serialized state: extensions/buzz/src/config-schema.test.ts, unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Validate the upgrade path on the exact head (recommended)
    Require the queued exact-head checks to confirm the Doctor migration preserves existing prefix behavior while enabling the channel overrides.

Technical review

Best possible solution:

Merge the owner-boundary repair after exact-head CI confirms the migration and channel delivery paths remain green.

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

Yes. Current-main schemas demonstrably omit the documented fields, and the existing shared pipeline establishes the affected delivery path; this review did not execute a local reproduction.

Is this the best way to solve the issue?

Yes. The PR reuses the canonical reply-prefix pipeline and corrects schema ownership rather than adding a parallel resolver.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs documented configuration that currently fails or falls back incorrectly, with limited channel-specific blast radius.
  • merge-risk: 🚨 compatibility: Existing configurations are migrated from a global prefix fallback into newly accepted channel-specific fields.
  • merge-risk: 🚨 message-delivery: The change affects text presented on automatic replies across several channel delivery paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains an after-fix authenticated Buzz Gateway delivery trace plus focused native-output regressions for the other changed delivery owners.

Evidence

What I checked:

Likely related people:

  • steipete: Current-head history and blame attribute the integrated reply-pipeline, Tlon, and delivery-test changes to this area. (role: recent area contributor and integrator; confidence: high; commits: 7f64cdc5b4ec, c527ff0fab04; files: extensions/clickclack/src/inbound.ts, extensions/feishu/src/reply-dispatcher.ts, extensions/tlon/src/monitor/index.ts)
  • ayaangazali: The related merged schema-parity repair and this PR’s original repair both cover strict bundled-channel configuration contracts. (role: prior schema-parity contributor; confidence: medium; commits: d2c9e74702f4; files: extensions/clickclack/src/config-schema.ts, extensions/feishu/src/config-schema.ts, extensions/twitch/src/config-schema.ts)

Rank-up moves

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

  • Let the queued exact-head checks complete before merge.

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 (24 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-24T19:43:02.585Z sha 1fd2cf0ab3b92c03546bfb79017ab7ab2199bd1c :: needs real behavior proof before merge. :: [P2] Do not certify Tlon before passing its channel context | [P2] Add ClickClack to Doctor's response-prefix migration | [P2] Scope the generic response-prefix documentation
  • reviewed 2026-08-25T01:58:41.958Z sha 1201b7884b1bdeeadfe991aa6ef0e3cd77227d76 :: needs real behavior proof before merge. :: [P2] Pass Tlon context before certifying it prefix-capable | [P2] Include ClickClack in Doctor’s response-prefix migration | [P2] Scope the documented response-prefix paths
  • reviewed 2026-08-25T06:57:35.914Z sha 1201b7884b1bdeeadfe991aa6ef0e3cd77227d76 :: needs real behavior proof before merge. :: [P2] Pass Tlon context before certifying it prefix-capable | [P2] Include ClickClack in Doctor’s response-prefix migration | [P2] Scope the generic response-prefix documentation
  • reviewed 2026-08-25T21:37:32.222Z sha 0d326cfe609143465dac9555f74c8d8e0239a505 :: needs real behavior proof before merge. :: [P2] Remove Tlon until it forwards prefix context | [P2] Add ClickClack to the response-prefix migration | [P2] Document the prefix-capable channel scope
  • reviewed 2026-08-25T22:57:33.093Z sha f225d23e84d5fe289d532fc3f41780387aaf3e76 :: needs real behavior proof before merge. :: [P2] Do not certify Tlon as prefix-capable | [P2] Migrate ClickClack's configured prefix | [P2] Scope the generic response-prefix documentation
  • reviewed 2026-08-26T04:19:28.490Z sha 7c6584ae3b4caad41655c38934a6b01358d038a8 :: needs real behavior proof before merge. :: [P2] Do not certify Tlon as prefix-capable | [P2] Add ClickClack to the response-prefix migration | [P2] Scope the documented response-prefix paths
  • reviewed 2026-08-26T06:06:32.824Z sha 9871f6237c16805175ba08fc35158446acd9d4b6 :: needs real behavior proof before merge. :: [P2] Remove Tlon until it resolves channel context | [P2] Include ClickClack in the prefix migration | [P2] Scope the documented response-prefix paths
  • reviewed 2026-08-26T21:15:20.618Z sha f54a25f :: needs real behavior proof before merge. :: [P2] Remove Tlon until its prefix context is complete | [P2] Add ClickClack to the response-prefix migration | [P2] Scope the generic response-prefix documentation

@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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

The P1 is real and fixed. The P2 is real too, but I want to be precise about its scope and check with you before expanding an SDK surface for it.

P1, Feishu. Confirmed exactly as described. extensions/feishu/src/reply-dispatcher.ts built the context as:

const prefixContext = createReplyPrefixContext({ cfg, agentId });

with channel: "feishu" and accountId both already in scope, and passed to createChannelMessageReplyPipeline six lines below. The give-away is that the plugin's own comment dispatcher already does it right (comment-dispatcher.ts:40-43 passes channel: "feishu"), so ordinary replies were the odd path out. Now:

const prefixContext = createReplyPrefixContext({ cfg, agentId, channel: "feishu", accountId });

extensions/feishu is 94 files / 1467 tests passing, boundary check exit 0.

P2, ClickClack model mode. Also confirmed, and narrower than "the setting has no effect". dispatchModelReply (inbound.ts:38-73) calls runtime.llm.complete and hands the raw text to sendClickClackText, bypassing the reply pipeline entirely, so no prefix can apply. In the default replyMode: "agent" path the shared pipeline does resolve it correctly, since src/channels/message/reply-pipeline.ts:106 builds createReplyPrefixOptions with both channel and accountId. So the key works in the default mode and is inert only in model mode.

Where I stopped: rendering a prefix onto raw text needs resolveResponsePrefixTemplate, which lives in core and is not exported through openclaw/plugin-sdk/*. Fixing model mode properly therefore means either exposing a render helper to plugins, which is a Plugin SDK surface addition and compatibility-sensitive, or routing model mode through the reply pipeline, which is a larger behavioral change to that mode. Both look like calls for you rather than for me to make inside a schema-parity PR.

So my question: would you prefer (a) a new SDK export plus the model-mode wiring, (b) routing model mode through the shared pipeline, or (c) leaving model mode as is and documenting that responsePrefix applies to agent-mode replies? I will do whichever, but I did not want to widen the SDK on my own initiative.

For the record on scoping: I did not drop ClickClack from the schema change, because unlike the truly inert cases I have closed before, this key is honored on that channel's default path.

@ayaangazali
ayaangazali force-pushed the fix/response-prefix-schema-parity branch from e098e3d to 644f9ab Compare August 9, 2026 17:12
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 9, 2026
@ayaangazali
ayaangazali force-pushed the fix/response-prefix-schema-parity branch from 644f9ab to d9e4f91 Compare August 9, 2026 17:58
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 17, 2026
@ayaangazali
ayaangazali force-pushed the fix/response-prefix-schema-parity branch from 60ed22d to 55119a1 Compare August 17, 2026 19:52
@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Aug 17, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (46e44baf460). This branch had picked up the recurring conflict in the generated config baseline (docs/.generated/config-baseline.counts.json and config-baseline.sha256); it is now 0 commits behind and merge-clean.

The baseline was not hand-merged. I reset both generated files to main and re-ran both generators, so the artifacts match what CI regenerates:

node --import tsx scripts/generate-config-doc-baseline.ts --check                  clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check      clean

Local proof at head 16fc2edf557:

src/plugins/contracts + src/config/schema.help.quality.test.ts   43 files, 1061 passed
src/cli/config-cli.test.ts                                      190 passed

On the red marks: check-lint, check-lint-core-5 and check-docs are failing here, and I do not believe any of them are this branch. All three die during pnpm install before their actual check step runs (::error::pnpm install failed, then Process completed with exit code 1), with no rule violations or docs drift reported. check-lint and check-lint-core-5 are also currently red on main itself (for example 44b41d5686d). This branch touches no package.json, pnpm-lock.yaml or pnpm-workspace.yaml.

I also think I made that worse: I pushed nine rebases within about a minute, so nine fork CI runs hit dependency install at once. That was my mistake in batching, not a change in the code. Happy to re-push to re-trigger if you would rather see a clean run.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (d8c1d90edb4), 0 behind and merge-clean. Both generated-artifact gates pass and the contract suites are green:

node scripts/run-vitest.mjs src/plugins/contracts src/config/schema.help.quality.test.ts   43 files
node scripts/run-vitest.mjs src/cli/config-cli.test.ts                                     190 passed
node --import tsx scripts/generate-config-doc-baseline.ts --check                           clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check               clean

One thing in the regenerated baseline is worth calling out so it is not mistaken for something this PR did. docs/.generated/config-baseline.counts.json moves core from 2324 to 2329 here. That growth is not from this change, which only touches channel schemas, and the channel count is the number this PR actually moves.

The core number is stale on main itself. On a pristine checkout of main with no changes at all:

$ node --import tsx scripts/generate-config-doc-baseline.ts --check
core: current 2329 > budget 2324; config surface grew; either remove config elsewhere or
consciously raise the budget in docs/.generated/config-baseline.counts.json in this PR
and justify it in the PR body.
Config baseline drift detected.
Hash mismatch: docs/.generated/config-baseline.sha256
exit 1

I confirmed the direction by forcing core back to 2324 on this branch, which reproduces that same current 2329 > budget 2324 failure. So the real core surface is already 2329 on main and only the committed budget is behind. Any PR that has to regenerate this file inherits the bump.

I did not want to silently raise a ratchet budget, and I also did not want to hand you a red gate, so I have kept the regenerated value and am flagging it here instead. If you would rather this PR pin core back to 2324 and let the check fail the way it already does on main, say so and I will switch it.

Separately, that drift looks worth a maintainer look on its own: the lane appears not to run on main pushes that touch no config path, so the budget can fall behind quietly and then surfaces on whichever contributor PR next touches config. I have not opened anything for it since raising the budget is a judgement call that belongs to you.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (19c916be139), 0 behind and merge-clean.

The check-lint and check-docs red on the previous head was not this branch. Both lanes run oxfmt --check, and it was failing repo-wide on .agents/skills/openclaw-release-validation/SKILL.md, which drifted in with #126055. That is fixed on main now by #126060, so this rebase picks the repair up and those lanes should go green.

Verified at this head, both generated-artifact gates clean and the suites this PR owns passing. Nothing about the change itself moved; same diff, newer base.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (784676537c9), 0 behind and merge-clean.

The jump to ten red checks on the previous head, including check-test-types and check-additional-extension-package-boundary, was a stale base rather than anything in this branch. My earlier rebase landed on main during a window where this was broken:

src/agents/subagents/announce/subagent-announce-direct-delivery.ts(85,5):
error TS2353: Object literal may only specify known properties, and
'resolveGatewayContext' does not exist ...
[tsgo] FAILED (exit 1)

main has since fixed it (#126040 and #126062 bound those dispatches to the Gateway instance, and that file now carries the comment "No resolveGatewayContext: this dispatch is bound to the Gateway instance"). I confirmed the current tip is clean by running the same lane on a pristine checkout of main, which exits 0, and again on this rebased head:

node scripts/run-tsgo-core-test-shards.mjs    exit 0

So this push simply moves the branch past that window. Nothing about the change itself moved; same diff, newer base.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

checks-node-changed-extensions-config-2 is a wall-clock performance budget in a plugin this branch does not touch.

FAIL extensions extensions/oc-path/src/oc-path/tests/scenarios/perf-determinism.test.ts
AssertionError: expected 2769.697463999997 to be less than 800

The assertion is timing, not behavior (perf-determinism.test.ts:15-19):

const start = performance.now();
...
bestElapsedMs = Math.min(bestElapsedMs, performance.now() - start);
expect(bestElapsedMs).toBeLessThan(localBudgetMs * perfBudgetMultiplier);

It already takes the best of several iterations, which is the right mitigation, and it still came in at 3.5x the budget. That is a loaded runner rather than a slow parser.

This branch changes responsePrefix on three channel config schemas and touches zero files under extensions/oc-path. It is pulled into this shard only because changed-extensions-config-* is selected by changed extension config paths, so touching any extension config runs the whole extension suite including 1Password, oc-path and the rest. Selection is not causation.

This head is 0 behind and merge-clean, and the suites this PR owns are green:

node scripts/run-vitest.mjs src/plugins/contracts src/config/schema.help.quality.test.ts   43 files, 1059 passed
node scripts/run-vitest.mjs src/cli/config-cli.test.ts                                     191 passed

I have not touched the perf test. Raising a timing budget to make a red mark go away is the kind of masking this repo's guidance warns about, and it is not my call on someone else's plugin. Worth flagging separately though: a best-of-N wall-clock assertion on shared CI runners will keep doing this to unrelated PRs, and there is no open issue tracking it that I could find.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased to 2cd69014c49, 0 behind. The earlier oc-path perf-determinism failure is gone; what remains is build-artifacts, and I do not think it is this PR.

The failing assertion:

plugins list --json median max RSS 400.6 MB exceeded 400 MB (samples: 401.6, 400.6, 367.3 MB)

I pulled the same job from five main runs earlier today to see what the gate measures without any PR content:

main run median samples
32585058804 317.4 351.6, 316.8, 317.4
32584294745 396.5 371.7, 398.6, 396.5
32583785857 369.1 367.6, 369.1, 393.4
32583308444 393.3 393.3, 398.9, 371.4
32582624100 396.7 371.1, 396.7, 396.8

Three of five main medians land within 7 MB of the 400 MB ceiling, individual samples reach 398.9 MB, and intra-run spread is 30 to 35 MB. This PR's 400.6 MB is inside that distribution.

scripts/check-cli-startup-memory.mjs is well built for what it was calibrated against: independent homes per sample and a median so one allocator spike cannot mask a regression, with the deliberate contract that two high samples fail. That contract only holds while the ceiling has headroom, and the sibling case documents what headroom was intended: statusJson is limited at 450 with the comment that status startup reaches about 430 MB, roughly 5 percent. pluginsList is currently at about 99 percent of its ceiling on main.

History, in case it is useful:

So the gate looks saturated rather than flaky: it can still fail a PR on noise, but it can no longer catch a real regression until main is already over the line. That reads like a startup import growth question for whoever owns the budget, not something this PR should absorb, and I did not want to paper over it by touching the limit from here. I could not find an existing issue tracking it.

Happy to be told I am wrong and that this PR does need to account for it.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Owner-boundary trace added. Rebased to 1201b7884b1, 0 behind.

Two halves, since "the schema accepts it" on its own does not show the setting doing anything.

1. Whether the key survives config load. Probe over the generated schema oracle, only bundled-channel-config-metadata.generated.ts swapped between main and this branch:

main                          this branch
clickclack  false             clickclack  true
feishu      false             feishu      true
twitch      true              twitch      true

So on main a documented channels.clickclack.responsePrefix or channels.feishu.responsePrefix fails config load and the prefix can never take effect. Worth being precise: twitch already accepted it at the channel root, so that entry is unchanged by this probe; the twitch part of this PR is about the rest of its schema surface, not this key.

2. What the accepted value does at the reply boundary. Driving createReplyPrefixOptions from src/channels/reply-prefix.ts, which is what getReply call sites consume:

[owner] clickclack  responsePrefix reaching getReply: "[clickclack] "
[owner] feishu      responsePrefix reaching getReply: "[feishu] "
[owner] twitch      responsePrefix reaching getReply: "[twitch] "

That is the value resolved through resolveEffectiveMessagesConfig(cfg, agentId, { channel, accountId }) and handed to the reply path, so the configured prefix reaches the outgoing message rather than stopping at the schema.

Validation at 1201b7884b1:

  • both generator --check gates: exit 0
  • src/plugins/contracts: 1066 passed
  • src/config/schema.help.quality.test.ts: 24 passed
  • src/cli/config-cli.test.ts: 198 passed
  • extensions/clickclack 1614, extensions/feishu 224, extensions/twitch 370 passed

Honest limit: this is the reply-prefix owner and the schema oracle, not a live ClickClack, Feishu or Twitch send. If you specifically want the mock-gateway harness rather than the owner boundary, say so and I will look at what that needs.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main.

Two things a reviewer should know after #129710 landed:

The twitch hunk conflicted for real. Main added historyLimit to the shared base with nearly the same rationale this branch uses for responsePrefix, so I kept both rather than taking a side:

// Both union branches are closed, so a root override declared only on the
// account shape is rejected whenever accounts is present.
historyLimit: z.number().int().min(0).optional(),
responsePrefix: z.string().optional(),

I also re-checked whether this PR is still needed at all, since main now contains responsePrefix in extensions/twitch/src/config-schema.ts. It is: that occurrence is on the account schema, while the shared base still lacked it, which is the case where channels.twitch.responsePrefix is rejected once accounts is present. clickclack and feishu still have no responsePrefix on current main either.

Local checks at the new head: twitch lane 229/229, src/plugins/contracts 1074/1074, both generator gates clean.

ayaangazali and others added 14 commits August 26, 2026 13:53
The ordinary reply dispatcher built the prefix context without channel or
accountId, so channels.feishu.responsePrefix and its account override fell
through to the global value. The comment dispatcher already passed them.
Twitch validates as a two-branch union with both branches closed, so
responsePrefix declared only on the account shape left
channels.twitch.responsePrefix rejected whenever accounts is present. Also
declares responsePrefix on ClickClackAccountConfig so typed callers can express
what its schema already accepts.
Model mode sends the completion straight to ClickClack instead of going through
the agent reply pipeline, so the documented responsePrefix parsed and then did
nothing. Resolve it through the public reply-pipeline seam so template
variables like {model} render from the completion's own provider and model.
systemPrompt is operator-owned, so a model can be instructed to emit the
configured prefix itself and the unconditional concatenation then sent it
twice. Match the shared reply normalizer's startsWith guard.
Main now requires access.channelIngress, which the hand-built fixture did not
provide, so the model-mode messages never dispatched. Drop the fixture and let
handleClickClackInbound resolve access from a DM-shaped message, matching the
sibling bot-loop tests.
A union alternative is a configuration mode an operator can pick, so a key
present in only one mode is unusable in the other even though the union still
validates. Treat any rejecting alternative as a rejection, and walk allOf when
collecting account schemas.
Applying the prefix to an outbound reply is per-channel wiring, not a shared
step. Buzz, Nostr, QA Channel, Raft, Reef and SMS never read it, so accepting
the key there validated a setting their delivery path ignores. Anchor the
contract to the channels that consume the prefix.
Exercise schema admission and the real shared reply dispatcher at the Twitch native send boundary, replacing redundant schema-only coverage. Keep Tlon fixtures on canonical imports and recording options.
Preserve the credited response-prefix repair alongside the core channel schema and durable Tlon invite fixes. Regenerate canonical config metadata and retain both complete behavioral test blocks.
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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

Labels

channel: buzz channel: feishu Channel integration: feishu channel: qa-channel Channel integration: qa-channel channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch commands Command implementations docs Improvements or additions to documentation extensions: clickclack extensions: qa-lab 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. 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. scripts Repository scripts size: M 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.

3 participants