Repository navigation
fix(channels): bundled channels reject the documented responsePrefix override - #118148
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:43 PM ET / 23:43 UTC. ClawSweeper reviewWhat this changesAdds response-prefix schema, migration, documentation, and reply-delivery support for Buzz, ClickClack, Feishu, QA Channel, Tlon, and Twitch. Merge readinessThis 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 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherChannel 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +29, Tests +399, Docs +19, Generated 0, Other 0. Total +447 across 28 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (24 earlier review cycles; latest 8 shown)
|
|
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. const prefixContext = createReplyPrefixContext({ cfg, agentId });with const prefixContext = createReplyPrefixContext({ cfg, agentId, channel: "feishu", accountId });
P2, ClickClack model mode. Also confirmed, and narrower than "the setting has no effect". Where I stopped: rendering a prefix onto raw text needs 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 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. |
e098e3d to
644f9ab
Compare
644f9ab to
d9e4f91
Compare
60ed22d to
55119a1
Compare
|
Rebased onto current 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: Local proof at head On the red marks: 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. |
|
Rebased onto current One thing in the regenerated baseline is worth calling out so it is not mistaken for something this PR did. The I confirmed the direction by forcing 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 Separately, that drift looks worth a maintainer look on its own: the lane appears not to run on AI-assisted. |
|
Rebased onto current The 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. |
|
Rebased onto current The jump to ten red checks on the previous head, including
So this push simply moves the branch past that window. Nothing about the change itself moved; same diff, newer base. AI-assisted. |
|
The assertion is timing, not behavior ( 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 This head is 0 behind and merge-clean, and the suites this PR owns are green: 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. |
|
Rebased to The failing assertion: I pulled the same job from five
Three of five
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 Happy to be told I am wrong and that this PR does need to account for it. |
|
Owner-boundary trace added. Rebased to 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 So on 2. What the accepted value does at the reply boundary. Driving That is the value resolved through Validation at
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. |
|
Rebased onto current main. Two things a reviewer should know after #129710 landed: The twitch hunk conflicted for real. Main added // 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 Local checks at the new head: twitch lane 229/229, |
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.
Co-authored-by: ayaangazali <[email protected]>
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.
|
Merged via squash.
|
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
responsePrefixfor Buzz and QA, retain ClickClack/Feishu/Twitch parity, and align exported types, Buzz manifest/catalog, generated metadata, and config baselines.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.
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, revision4f554b6385065b698db819498a6f359b17a45459. It used dedicated task identities/room and deterministicmock-openaimodelgpt-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.1established 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 main25a16dd96c42876cc80b0ad754a612a75524b4eb. 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 andopenclaw/ci-gate. Native prepare/merge are still pending. This is not a merge-completion claim.