Skip to content

feat(matrix): add AI-gated participation and final-reply freshness controls - #73455

Closed
bdjben wants to merge 15 commits into
openclaw:mainfrom
bdjben:matrix-custom-2026.4.26
Closed

bdjben wants to merge 15 commits into
openclaw:mainfrom
bdjben:matrix-custom-2026.4.26

Conversation

@bdjben

@bdjben bdjben commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

feat(matrix): add AI-gated participation and final-reply freshness controls

Summary

  • Problem: In busy Matrix rooms with multiple OpenClaw bots, a bot can draft a reply while newer visible room activity arrives, or reply when the user intended only one bot / a subset of bots to participate.
  • Why it matters: Multi-agent Matrix rooms need user-intent-aware participation control and final-send freshness checks so replies are relevant, non-stale, and respectful of room-level direction.
  • What changed:
    • Added Matrix participation policy handling with AI-first parsing, optional deterministic modes, durable room-scoped directives, and explicit /steer / command exemptions.
    • Added latest-visible activity tracking and final-reply freshness handling so stale drafts can be revised, suppressed, or sent as-is according to config.
    • Started participation/freshness gating speculatively while reply drafting proceeds, then awaited/used the result at delivery time.
    • Added schema/types/account-config support plus regression coverage for handler behavior, account merging, freshness scope, and participation state.
  • What did NOT change (scope boundary):
    • No changes to non-Matrix channels.
    • No new external service integration.
    • No change to command/tool execution authorization.
    • No deterministic fallback is introduced for AI-first participation/freshness behavior.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: N/A — feature addition.
  • Missing detection / guardrail: N/A.
  • Contributing context (if known): Matrix rooms can contain multiple configured bots and normal human room traffic. The prior flow generated/delivered replies without a first-class room participation policy layer or a final visible-activity freshness gate.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • extensions/matrix/src/matrix/monitor/handler.test.ts
    • extensions/matrix/src/matrix/monitor/latest-visible.test.ts
    • extensions/matrix/src/matrix/monitor/participation-state.test.ts
    • extensions/matrix/src/matrix/account-config.test.ts
    • extensions/matrix/src/config-schema.test.ts
  • Scenario the test should lock in:
    • Participation directives can suppress non-target bots while allowing intended bots.
    • /steer and explicit command paths remain exempt from participation suppression.
    • New visible room activity after draft start is detected before delivery.
    • Final freshness behavior can revise, suppress, or send unchanged according to config/AI decision.
    • Participation/freshness account-level config merges correctly through nested account config.
  • Why this is the smallest reliable guardrail:
    • These behaviors sit at the Matrix monitor seam where room events become agent runs and outbound replies. Handler-level tests cover the real control flow without requiring a live Matrix homeserver.
  • Existing test that already covers this (if any):
    • Existing Matrix handler tests covered baseline reply flow; this PR extends that suite for the new participation/freshness gates.
  • If no new test is added, why not:
    • N/A — new tests are included.

User-visible / Behavior Changes

Matrix channel config now supports two optional blocks: participation and freshness.

streaming recommendation for multi-bot rooms

For rooms with many bots, users should leave Matrix streaming set to off for best results. Non-streamed replies give the final participation/freshness gate a chance to decide before any visible partial output is emitted.

Supported streaming values remain:

  • "partial" — stream partial visible output.
  • "quiet" — stream in quiet mode.
  • "off" — do not stream partial visible output; recommended for rooms with many bots.
  • true / false — legacy boolean form.

participation config

Controls whether a Matrix bot should participate in a group-room turn when users give room-level participation instructions such as “AgentAlpha only”, “AgentAlpha and AgentBeta”, “everyone except AgentGamma”, or “no bots reply”.

  • participation.enabled (boolean, optional)

    • Enables/disables Matrix group participation control.
    • When disabled, the bot follows the pre-existing Matrix reply behavior.
  • participation.strategy ("ai-first" | "deterministic" | "ai-delivery-gate" | "deterministic-then-ai", optional)

    • "ai-first": uses the configured model to interpret participation intent first. This mode does not silently fall back to deterministic decision-making.
    • "deterministic": uses deterministic participation parsing only.
    • "ai-delivery-gate": allows drafting to proceed and applies an AI participation decision at delivery time.
    • "deterministic-then-ai": tries deterministic parsing first, then uses AI when deterministic parsing is insufficient.
  • participation.model (string, optional)

    • Optional model override for AI-backed participation parsing.
    • If omitted, the normal configured model path is used.
  • participation.minRoomMembers (integer >= 0, optional)

    • Only enables participation control when the joined Matrix room member count is at least this value.
    • Useful for keeping small rooms simple while enabling control in larger rooms.
  • participation.minAgentMembers (integer >= 0, optional)

    • Only enables participation control when the room has at least this many configured bot/agent members.
    • Useful for targeting behavior specifically to multi-bot rooms.
  • participation.persistence ("off" | "explicit" | "always", optional)

    • "off": participation directives are not persisted beyond the immediate decision.
    • "explicit": only explicitly persistent directives are stored.
    • "always": room participation policy is stored whenever a directive produces a durable room policy.

freshness config

Controls what happens when a bot has produced a final draft but newer visible Matrix room activity appears before delivery.

  • freshness.enabled (boolean, optional)

    • Enables/disables final-reply freshness control.
    • When disabled, replies follow the pre-existing delivery behavior.
  • freshness.mode ("revise" | "suppress" | "auto" | "send-as-is", optional)

    • "revise": if newer visible room activity arrives, rerun/revise the reply before sending.
    • "suppress": if newer visible room activity arrives, suppress the stale reply.
    • "auto": let configured freshness logic decide among allowed final actions.
    • "send-as-is": detect/log freshness state but send the existing draft unchanged.
  • freshness.scope ("room" | "thread-aware", optional)

    • "room": any newer visible room activity can make the draft stale.
    • "thread-aware": considers thread/reply context and ignores unrelated activity where appropriate.
  • freshness.draftHoldbackMs (integer >= 0, optional)

    • Optional holdback window before final delivery.
    • Gives near-simultaneous Matrix events a chance to arrive before the final freshness decision.
  • freshness.model (string, optional)

    • Optional model override for AI-backed final freshness decisions.
    • If omitted, the normal configured model path is used.
  • freshness.minRoomMembers (integer >= 0, optional)

    • Only enables freshness control when joined Matrix room member count is at least this value.
  • freshness.minAgentMembers (integer >= 0, optional)

    • Only enables freshness control when the room has at least this many configured bot/agent members.
  • freshness.allowedFinalActions (Array<"revise" | "suppress" | "send-as-is">, optional, min length 1)

    • Restricts which final delivery actions the freshness chooser may select.
    • "revise": rewrite the reply using refreshed room context.
    • "suppress": do not send the reply.
    • "send-as-is": send the existing draft unchanged.
  • freshness.aiDeterminesFinalAction (boolean, optional)

    • When enabled, the model chooses the final action from the available actions instead of only following a fixed final action.
  • freshness.finalAction ("revise" | "suppress" | "send-as-is", optional)

    • Fixed final action to apply when freshness control determines that the draft is stale and AI final-action selection is not being used.

Example intent phrases this supports in busy rooms:

AgentAlpha only
AgentAlpha and AgentBeta should answer
Everyone except AgentGamma
No bots reply to this one
/reset participation

Diagram (if applicable)

Before:
[Matrix room message]
  -> [bot drafts reply]
  -> [reply delivered even if room state changed or only some bots were intended]

After:
[Matrix room message]
  -> [start participation/freshness gate speculatively]
  -> [bot drafts reply in parallel]
  -> [delivery awaits/uses gate result]
  -> [send / revise / suppress according to participation + latest-visible state]

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (Yes)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (Yes)
  • If any Yes, explain risk + mitigation:
    • New/changed network calls: when AI-backed participation/freshness modes are enabled, the Matrix monitor may call the configured simple-completion model to classify participation or final freshness behavior. This uses the existing OpenClaw model/auth runtime rather than introducing a new provider path.
    • Data access scope: the AI decision receives bounded Matrix room context needed to decide participation/freshness. Mitigations include existing model routing controls, configurable enablement/model selection, room/member thresholds, and no persistence of raw stored directive source text in the participation state store.

Repro + Verification

Environment

  • OS: macOS / Darwin
  • Runtime/container: local OpenClaw repo worktree
  • Model/provider: existing configured OpenClaw simple-completion runtime for AI participation/freshness decisions
  • Integration/channel: Matrix
  • Relevant config (redacted):
    • Matrix streaming, participation, and freshness channel/account config.

Steps

  1. Configure a Matrix group with multiple configured bots such as AgentAlpha, AgentBeta, and AgentGamma.
  2. Leave Matrix streaming set to off for the clearest multi-bot behavior.
  3. Send a normal room message and verify baseline reply behavior remains intact.
  4. Send a participation directive such as “AgentAlpha only”, “AgentAlpha and AgentBeta”, “everyone except AgentGamma”, or “no bots reply” and verify selected bots are allowed/suppressed.
  5. Trigger a reply while another visible room event arrives before delivery.
  6. Verify freshness handling follows the configured mode/final action: revise, suppress, or send as-is.

Expected

  • Participation directives affect only eligible Matrix group-room replies.
  • Explicit commands and /steer are not suppressed by participation control.
  • Stale final replies are handled according to freshness configuration.
  • AI-first participation/freshness modes do not silently fall back to deterministic decision-making.
  • Multi-bot rooms behave best with streaming: "off", because no partial visible reply is emitted before the final gate.

Actual

  • Verified by targeted Matrix monitor/config tests and build.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Verification run locally:

pnpm vitest run extensions/matrix/src/matrix/monitor/handler.test.ts
# passed: 105/105

pnpm vitest run \
  extensions/matrix/src/config-schema.test.ts \
  extensions/matrix/src/matrix/account-config.test.ts \
  extensions/matrix/src/matrix/monitor/latest-visible.test.ts \
  extensions/matrix/src/matrix/monitor/participation-state.test.ts \
  extensions/matrix/src/matrix/monitor/index.test.ts \
  extensions/matrix/src/matrix/monitor/direct.test.ts \
  extensions/matrix/src/matrix/monitor/room-history.test.ts
# passed: 73/73

pnpm build
# passed

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
    • Rebased branch builds cleanly on top of v2026.4.26.
    • Matrix handler test suite passes with participation/freshness changes.
    • Config schema/account config tests pass with new nested keys.
    • Generated bundled channel config metadata is updated.
  • Edge cases checked:
    • /steer and explicit command paths remain exempt.
    • Room-scoped participation policy state redacts stored source text.
    • Thread-aware freshness ignores irrelevant thread/root activity where appropriate.
    • Final freshness action is constrained to allowed actions.
    • Dummy bot names such as AgentAlpha, AgentBeta, and AgentGamma are used in examples instead of deployment-specific names.
  • What you did not verify:
    • Live Matrix homeserver end-to-end behavior in this PR run.
    • Provider-specific model quality across all supported model providers.
    • Long-running multi-bot room performance under high message volume.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (Yes)
  • Migration needed? (No)
  • If yes, exact upgrade steps:
    • Existing Matrix configs continue to work.
    • For rooms with many bots, set or keep Matrix streaming: "off" for best results.
    • New participation behavior is controlled through optional matrix.participation channel/account config.
    • New final-reply freshness behavior is controlled through optional matrix.freshness channel/account config.
    • No manual migration is required.

Risks and Mitigations

  • Risk: AI participation/freshness calls may add latency at reply time.

    • Mitigation: The gate starts speculatively while drafting proceeds, and delivery reuses/awaits the result instead of always serializing the decision before drafting.
  • Risk: Incorrect participation classification could suppress a useful reply.

    • Mitigation: Behavior is configurable by strategy, model, thresholds, persistence, and allowed final actions. Explicit commands and /steer remain exempt.
  • Risk: Stale-draft freshness checks could over-trigger in active rooms.

    • Mitigation: Freshness scope supports room/thread-aware behavior, ignores reaction/transport noise, and protects relevant thread/reply target events.
  • Risk: Durable room participation state could store user text unnecessarily.

    • Mitigation: Stored participation directives omit/redact raw source text; persisted state stores only normalized directive structure, timestamps, and updater metadata.

@bdjben
bdjben requested a review from a team as a code owner April 28, 2026 09:36
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: matrix Channel integration: matrix gateway Gateway runtime cli CLI command changes scripts Repository scripts agents Agent runtime and tooling size: XL labels Apr 28, 2026
@clawsweeper

clawsweeper Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw.

Close as low-signal/unmergeable: the Matrix idea is useful and still tracked separately, but this branch is conflicting, release-based, missing real behavior proof, and mixes the feature with unrelated release workflow, changelog, updater, gateway, and live-test churn plus concrete patch blockers.

So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome.

Review details

Best possible solution:

Close this branch and keep the remaining Matrix product work in the canonical narrow issue, then invite a fresh main-based Matrix-only PR that defines the opt-in contract, avoids release/ops churn, uses approved state/plugin seams, and includes real Matrix proof.

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

Not applicable for the requested feature as a live bug reproduction. The merge blockers are source-reproducible from the PR branch, and the narrower current-main Matrix gap is already source-proven in the linked canonical issue.

Is this the best way to solve the issue?

No. The best solution is not to repair this mixed release-based branch; it is to submit a narrow main-based Matrix PR after maintainers settle the opt-in config/default/state contract.

Security review:

Security review needs attention: Security review needs attention because this Matrix PR also changes secret-bearing release/Telegram package workflow behavior and defaults Matrix AI room-context decisions on.

  • [medium] Unrelated package-source workflow runs with QA secrets — .github/workflows/npm-telegram-beta-e2e.yml:11
    The workflow adds ref, url, and artifact package sources for the npm Telegram E2E lane, which runs in qa-live-shared with Convex/OpenAI-capable secrets. That release/supply-chain surface needs a separate owner-reviewed PR or removal from this Matrix feature branch.
    Confidence: 0.84
  • [medium] Matrix room context can be sent to a model by default — extensions/matrix/src/matrix/monitor/index.ts:246
    Because the new participation/freshness gates default to enabled when config is omitted, existing Matrix rooms can start sending bounded room context to the configured model without an explicit opt-in.
    Confidence: 0.88

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read and applied: Root and relevant scoped policy files were read; the review applied the extension boundary, config compatibility, storage, changelog, workflow/security, docs, and real-proof rules. (AGENTS.md:1, b5999bc6a07d)
  • Live PR state: The live PR is open, external-authored, not protected by maintainer/security/release-blocker labels, and currently reports mergeable=CONFLICTING at head 1f39d1b. (1f39d1b3b1a4)
  • Dirty release-based branch: The commit stack contains 14 release/CI/updater/test/changelog commits from before the one Matrix feature commit, matching the author's own comment that this was a noisy release-based attempt. (1f39d1b3b1a4)
  • Current main still tracks the narrow Matrix gap elsewhere: The related narrow Matrix sibling-mention issue remains open and its latest ClawSweeper review says current main lacks that opt-in pre-dispatch gate while this broad PR is not a safe canonical replacement.
  • Current main mention gate is active-account only: Current main builds mention regexes for the active Matrix route and resolves wasMentioned against selfUserId, so it does not implement the broader PR's participation/freshness behavior. (extensions/matrix/src/matrix/monitor/handler.ts:1129, b5999bc6a07d)
  • Current main has no Matrix participation/freshness config: The current Matrix schema exposes requireMention and allowBots but no participation or freshness blocks, confirming the requested capability is not already implemented on main. (extensions/matrix/src/config-schema.ts:60, b5999bc6a07d)

Likely related people:

  • Gustavo Madeira Santana: Matrix history shows the allowBots bot-to-bot policy and multiple Matrix monitor routing changes near the sibling-account/mention-gating surface. (role: introduced adjacent Matrix routing behavior; confidence: high; commits: ab97cc3f11a5, 1ea85a5d0bab, 3ceec929df0f; files: extensions/matrix/src/matrix/monitor/handler.ts, extensions/matrix/src/config-schema.ts, extensions/matrix/src/types.ts)
  • steipete: Current blame and recent history touch the Matrix monitor/config files, and the unrelated release/workflow commits in this branch are also in Peter Steinberger's area history. (role: recent adjacent Matrix and release-workflow contributor; confidence: medium; commits: a02813164dd5, 605cb60586eb, e3a99aa2ce61; files: extensions/matrix/src/matrix/monitor/handler.ts, extensions/matrix/src/config-schema.ts, .github/workflows/npm-telegram-beta-e2e.yml)
  • vincentkoc: Recent current-main commits and history touch Matrix handler/config surfaces and broader config/runtime seams that this PR changes. (role: recent Matrix/config area contributor; confidence: medium; commits: 8c802aa68351, 687030cbf22c; files: extensions/matrix/src/matrix/monitor/handler.ts, extensions/matrix/src/matrix/account-config.ts, extensions/matrix/src/config-schema.ts)

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

@greptile-apps

greptile-apps Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds AI-gated participation control and final-reply freshness gating for Matrix multi-bot rooms, with speculative parallel execution, durable room-scoped directives, thread-aware stale-draft detection, and full schema/config/test coverage for the new participation and freshness config blocks.

  • The AI participation system prompt at participation-policy.ts:314 contains a malformed schema string — \"includeAgentIds? and \"excludeAgentIds? fields are missing their closing quotes — which may degrade model output quality for those optional array fields. Two open P1 findings from the prior review round (pre-draft holdback suppressing revise/auto modes unconditionally, and the silent deterministic fallback inside resolveParticipationDecision) remain unresolved in this revision.

Confidence Score: 4/5

Mergeable with caution — two open P1 findings from the prior review round remain unresolved; new finding is P2 only.

Score is capped at 4 because two P1 issues identified in prior review threads are still present: the pre-draft holdback path unconditionally suppresses turns for revise and auto freshness modes instead of passing them through, and resolveParticipationDecision contains a silent deterministic fallback that violates the ai-first no-fallback contract. The only new finding in this review pass is a P2 (malformed AI schema string). No P0 issues were identified.

extensions/matrix/src/matrix/monitor/handler.ts (pre-draft holdback freshness mode handling), extensions/matrix/src/matrix/monitor/participation-policy.ts (resolveParticipationDecision fallback + malformed schema prompt)

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/matrix/src/matrix/monitor/participation-policy.ts
Line: 314

Comment:
**Malformed JSON schema in AI participation system prompt**

The schema description string passed to the model has missing closing quotes on the `includeAgentIds` and `excludeAgentIds` fields:

```
"includeAgentIds?:string[],   ← missing closing "
"excludeAgentIds?:string[],   ← missing closing "
```

Because neither field is closed, a model that parses this literally as JSON sees `includeAgentIds?:string[],` and the rest as a single unclosed key, which garbles the remaining fields. Even models that infer the intent may produce lower-quality JSON output (e.g. omitting those optional arrays or misclassifying `persistence`), silently degrading participation decisions.

The corrected schema should use consistent quoting:

```
{"action":"none|open|subset_only|exclude_subset|silence","includeAgentIds?":["string"],"excludeAgentIds?":["string"],"persistence":"message|room","clearsStoredPolicy?":boolean}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "matrix: overlap participation AI with dr..." | Re-trigger Greptile

Comment on lines +2360 to +2371
} else if (preDraftRoomChanged) {
logVerboseMessage(
`matrix suppressing turn before draft start after holdback room=${roomId}`,
);
logFreshnessDecision({
stage: "pre-draft-holdback",
action: "suppress",
roomChanged: true,
});
await commitInboundEventIfClaimed();
return;
}

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.

P1 Pre-draft holdback ignores revise and auto freshness modes

When draftHoldbackMs > 0 and the room changes during the holdback window, every mode except "send-as-is" falls into the else if (preDraftRoomChanged) branch and suppresses the turn entirely. This directly contradicts the configured mode semantics:

  • "revise" — documented as "rerun/revise the reply before sending", but here the turn is silently dropped before a draft is ever started.
  • "auto" — documented as "let configured freshness logic decide among allowed final actions", but the AI is never consulted; it suppresses unconditionally.

Only "suppress" is handled correctly by this path. The branch should check freshnessMode === "suppress" explicitly, and let "revise" / "auto" continue (allowing the freshness-aware resolver and final-gate to take over later in the pipeline).

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/matrix/src/matrix/monitor/handler.ts
Line: 2360-2371

Comment:
**Pre-draft holdback ignores `revise` and `auto` freshness modes**

When `draftHoldbackMs > 0` and the room changes during the holdback window, every mode except `"send-as-is"` falls into the `else if (preDraftRoomChanged)` branch and suppresses the turn entirely. This directly contradicts the configured mode semantics:

- `"revise"` — documented as "rerun/revise the reply before sending", but here the turn is silently dropped before a draft is ever started.
- `"auto"` — documented as "let configured freshness logic decide among allowed final actions", but the AI is never consulted; it suppresses unconditionally.

Only `"suppress"` is handled correctly by this path. The branch should check `freshnessMode === "suppress"` explicitly, and let `"revise"` / `"auto"` continue (allowing the freshness-aware resolver and final-gate to take over later in the pipeline).

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +378 to +382
const currentDirective =
params.currentDirective ??
(typeof params.text === "string"
? parseParticipationDirective({ text: params.text, availableAgents: params.availableAgents })
: undefined);

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.

P2 Silent deterministic fallback inside resolveParticipationDecision

When currentDirective is undefined and a text parameter is provided, the function silently falls back to parseParticipationDirective (deterministic parsing). This contradicts the explicit design constraint that "ai-first" must not fall back to deterministic decision-making.

While no current call site in handler.ts passes text without also providing a resolved currentDirective, the optional parameter makes it easy to accidentally invoke the fallback — for example, from tests or future call sites that pass raw message text. Removing the text parameter and the inline deterministic fallback from this function would make the "no silent fallback" contract explicit and hard to violate.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/matrix/src/matrix/monitor/participation-policy.ts
Line: 378-382

Comment:
**Silent deterministic fallback inside `resolveParticipationDecision`**

When `currentDirective` is `undefined` and a `text` parameter is provided, the function silently falls back to `parseParticipationDirective` (deterministic parsing). This contradicts the explicit design constraint that `"ai-first"` must not fall back to deterministic decision-making.

While no current call site in `handler.ts` passes `text` without also providing a resolved `currentDirective`, the optional parameter makes it easy to accidentally invoke the fallback — for example, from tests or future call sites that pass raw message text. Removing the `text` parameter and the inline deterministic fallback from this function would make the "no silent fallback" contract explicit and hard to violate.

How can I resolve this? If you propose a fix, please make it concise.

@bdjben

bdjben commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Closing this noisy release-based attempt. A clean main-based PR is staged locally, but pushing it requires the GitHub token to include workflow scope because upstream main now contains workflow files.

@bdjben bdjben closed this Apr 28, 2026
@bdjben bdjben reopened this Apr 28, 2026
@bdjben

bdjben commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Reopened. Note, this should have been marked [AI-assisted]; will be mindful of that in the future.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 30, 2026
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label May 30, 2026
@barnacle-openclaw barnacle-openclaw Bot removed the stale Marked as stale due to inactivity label May 30, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

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

Labels

agents Agent runtime and tooling channel: matrix Channel integration: matrix cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants