Skip to content

refactor(channels): unify configured binding resolution - #119414

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0804-channels-luem8u
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0804-channels-luem8u

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Configured channel bindings repeatedly compiled providers, normalized conversations, selected precedence, and materialized session-key lookups. This is part of a maintainer-requested project-wide production LOC reduction campaign.

Why This Change Was Made

Use canonical loaded-plugin binding compilation, precedence selection, and exact/wildcard session lookup paths without changing public SDK contracts or provider discovery.

User Impact

Channel and ACP routing preserve account, thread, wildcard, and exact-match behavior with 124 fewer production lines.

Evidence

Exact-head mock-channel binding transcript

A read-only, in-memory mock-channel harness executed nine real production modules, including all four changed configured-binding modules and the actual consumer registry. The wildcard rule was intentionally registered before the exact rule to prove precedence. Fixture identifiers only; no gateway state or credentials were used.

HEAD aa7d51ed35085f55bb526b6ecdcfc99e327bbfac
PRODUCTION modules=9 changed-modules=4 mock-channel=mock-chat
REGISTRY bindings=3 channels=1 order=wildcard,exact,thread-exact
DIRECT account=work conversation=room-7 -> rule=account-exact session=agent:main:mock-chat:work:room-7
DIRECT account=guest conversation=room-7 -> rule=account-wildcard session=agent:main:mock-chat:guest:room-7
THREAD account=work conversation=thread-42 parent=room-7 -> rule=thread-exact priority=20 session=agent:main:mock-chat:work:thread-42
THREAD account=work conversation=thread-99 parent=room-7 -> rule=account-exact priority=10 session=agent:main:mock-chat:work:room-7
REVERSE session=agent:main:mock-chat:work:room-7 -> rule=account-exact
REVERSE session=agent:main:mock-chat:guest:room-7 -> rule=account-wildcard
NO_MATCH account=work conversation=unknown -> null
PASS 8 mock-channel harness checks; exact-head production compiler/matcher/registry/reverse lookup executed

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 02:17
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 10:23 PM ET / August 5, 2026, 02:23 UTC.

ClawSweeper review

What this changes

The PR collapses duplicate configured channel-binding compilation, precedence selection, record materialization, and session-key lookup helpers into canonical paths without changing the public SDK.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep open. Source comparison found the refactor behavior-equivalent, but the PR body provides tests and CI rather than inspectable after-fix runtime or harness proof for this routing-sensitive change.

Priority: P3
Reviewed head: aa7d51ed35085f55bb526b6ecdcfc99e327bbfac

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is clean by source comparison, but real behavior proof remains below the merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The body reports focused tests, CI, and unspecified equivalence checks, but no inspectable after-fix runtime or ephemeral-gateway harness transcript/artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The body reports focused tests, CI, and unspecified equivalence checks, but no inspectable after-fix runtime or ephemeral-gateway harness transcript/artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Inbound precedence remains equivalent: Current main separates exact-account and wildcard candidates, then chooses the higher provider match priority within each tier; the PR replaces this with the equivalent lexicographic account-priority/match-priority selection while retaining first-rule ties.
Session-key precedence remains equivalent: The prior exact-match assignment, break, and post-loop return select the same rule as the PR's immediate return; wildcard selection still retains the last matching wildcard rule.
Existing boundary coverage: Current tests cover parent fallback versus direct thread binding, sender/topic specificity, exact account over wildcard, and reverse session-key collision resolution.
Findings None None.
Security None None.

How this fits together

Configured channel bindings turn channel, account, and conversation facts into a selected agent target and persistent ACP session record. Channel routing and ACP reverse lookup consume the resolved record before dispatching work.

flowchart LR
A[Channel event or session key] --> B[Normalize account and conversation]
B --> C[Compile loaded-plugin binding rules]
C --> D[Select exact or wildcard match]
D --> E[Materialize ACP target record]
E --> F[Route channel or recover session]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The body reports focused tests, CI, and unspecified equivalence checks, but no inspectable after-fix runtime or ephemeral-gateway harness transcript/artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The supplied body identifies tests and CI but does not include inspectable after-fix gateway or mock-channel harness output proving the routing-preservation claim.
  • Complete next step (P2) - No mechanical repair is indicated; the remaining merge gate is contributor-provided real-behavior evidence.
Agent review details

Security

None.

PR surface

Source -124. Total -124 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 4 65 189 -124
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 65 189 -124

Review metrics

Metric Value Why it matters
Production vs test LOC production -124, tests 0 All four changed files are production routing code; the net reduction is consistent with the stated consolidation and adds no duplicate tests.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the canonical resolver after a redacted runtime or ephemeral-gateway harness transcript demonstrates direct-versus-parent, exact-versus-wildcard, and reverse session-key selection on the PR head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the canonical resolver after a redacted runtime or ephemeral-gateway harness transcript demonstrates direct-versus-parent, exact-versus-wildcard, and reverse session-key selection on the PR head.

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

Not applicable: this PR refactors existing configured-binding behavior rather than reporting a separate failure; source comparison establishes the affected behavior contracts.

Is this the best way to solve the issue?

Yes, subject to runtime proof: consolidating the one-use wrappers keeps a single compiler and selector while preserving the loaded-plugin and precedence boundaries.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a maintainer-labeled internal refactor with no demonstrated current user regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports focused tests, CI, and unspecified equivalence checks, but no inspectable after-fix runtime or ephemeral-gateway harness transcript/artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a maintainer-labeled internal refactor with no demonstrated current user regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports focused tests, CI, and unspecified equivalence checks, but no inspectable after-fix runtime or ephemeral-gateway harness transcript/artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Directly maintained the configured-binding compiler in the hot-path loaded-plugin work and authored this consolidation. (role: recent area contributor; confidence: high; commits: 40b10eb3d198, aa7d51ed3508; files: src/channels/plugins/configured-binding-compiler.ts, src/channels/plugins/configured-binding-match.ts)

Rank-up moves

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

  • Add a redacted after-fix gateway or mock-channel harness transcript covering direct/thread, exact/wildcard, and reverse session-key resolution; a PR-body update should trigger re-review.

Rating scale

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

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

Workflow

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

@steipete
steipete merged commit 03cbc2c into main Aug 5, 2026
193 of 198 checks passed
@steipete
steipete deleted the codex/loc-0804-channels-luem8u branch August 5, 2026 02:55
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main: (22 commits)
  refactor(plugins): consolidate lifecycle hook dispatch (#119429)
  fix(ci): stabilize TUI PTY proof ownership (#119420)
  test(system-agent): reduce suite setup overhead (#119424)
  fix(ui): keep session rail pill status from overlapping the headline (#119397)
  fix(discord): avoid doctor runtime loading (#119391)
  fix(media): decouple playback cache retention (#119417)
  fix(slack): infer upload filename extensions from MIME types (#119399)
  refactor(channels): unify configured binding resolution (#119414)
  refactor(google-meet): unify gateway and tool dispatch (#119413)
  test(state): reuse legacy database fixtures (#119423)
  fix(reset): preserve bootstrap guidance for dynamic models (#119179)
  fix(chutes): honor serving context limits (#119196)
  refactor(status): consolidate scan projections and lazy loaders (#119412)
  fix(status): status --all slows down with missing plugins (#119203)
  refactor(gateway): consolidate usage reporting and caches (#119409)
  perf(gateway): keep reload and recovery machinery off gateway cold start (#119094)
  fix(cli): align TaskFlow controller columns for wide text (#118801)
  fix: make startup migration restart guidance install-neutral (#119406)
  fix(ci): preserve cache warmer shard envelopes (#119403)
  fix(sessions): preserve compatible auth profiles on model changes (#117550)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant