Skip to content

chore(channels): cover conversation ID normalization at the route boundary - #148367

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/conversation-target-normalization-20260914
Oct 16, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/conversation-target-normalization-20260914

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The route-projection tests do not exercise numeric, blank, missing, or non-finite conversation IDs at the plugin boundary. The production normalizer from this PR is already on main through #164269; only the missing route tests remain.

User Impact

No production behavior change. The tests protect delivery-target selection for child and parent IDs while preserving the existing plugin, generic-fallback, and thread-only cases.

Why This Change Was Made

Retain 22 table-driven cases through the real route-projection owner: finite numbers truncate before stringification, strings trim without numeric coercion, invalid child IDs produce no target, and invalid parent IDs fall back to the child. The signed main integration preserves the original PR ancestry and removes the already-landed production delta. Against the frozen main baseline, the candidate changes one test file by 40 lines.

Evidence

  • Candidate: 4daffce47c11f7cfaeddf6b350c2c34a92cb9624, based on main c5a6724c26556cc6759cb2bec49cc676cb5c9dc0. The test file and production normalizer are byte-identical to the original PR head; the route owner changed only comments, and the canonical ID helper is unchanged.
  • Fresh P3 autoreview: no accepted or actionable findings. All 22 added cases match the normalization contract; the four existing cases are preserved. git diff --check passed.
  • Historical focused proof at cdbae6dd74c8d15cbd23a9a1687210cbb2449a3f: 26/26 tests passed, no skips, through the repository test entrypoint on Testbox. Single-worker wall time was 29.18 seconds; Vitest reported 26.78 seconds. Historical CI test-step cost was 27 seconds. These results do not qualify the new published head.
  • Current-head Linux proof: job 116808579302 executed all 26 cases in src/channels/route-projection.test.ts: 26 passed, zero skipped, including every added child/parent case. Tested merge 01c2216884283d2d2293ba1c645f6889b25dfff2 contains published head 4daffce47c11f7cfaeddf6b350c2c34a92cb9624; its test, route, normalizer and canonical ID-helper blobs match that head exactly. Log SHA256: d35454e411e8fb53ed3fe3b9fcf8c59b2f9ace583749e55d49bc713fab13347a.
  • Current CI cost: 40.11 seconds Vitest duration, 95% transformation; individual assertions took 9-82 ms. The complete job took 107 seconds. These tests reuse the existing fixture to protect the real route-to-plugin boundary, which helper-only unit coverage cannot verify.
  • Exact-file formatting and lint passed, including zero lint warnings/errors; test-type checks and all other planned CI checks passed. Current-head CI run 38849807397 completed successfully. Security Review run 38850788683 published successful dependency-review, security-sensitive-review and CI-gate statuses for the same head. Native completed-hosted preparation passed with that exact head at 2026-10-16T04:29:57Z. No application tests or builds were run locally for this refresh; no admin exception or check waiver was used.
  • The old failed openclaw/ci-gate was correctly published: CI run 36143146316 failed after the older successful run 35958615982. Security Review run 36147799731 published that result. No status override or blind rerun was used.

@vincentkoc vincentkoc self-assigned this Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 14, 2026 16:17
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 2:37 PM ET / 18:37 UTC (Revision 6).

ClawSweeper review

What this changes

The branch replaces duplicated conversation ID conversion with OpenClaw’s shared normalizer and adds tests preserving child and parent target formatting.

Merge readiness

✅ Ready for maintainer review

Keep open: no introduced correctness defect was found, and distinct route-level coverage remains absent from main. The MEMBER author and maintainer label also require maintainer handling rather than automatic closure.

Priority: P3
Reviewed head: cdbae6dd74c8d15cbd23a9a1687210cbb2449a3f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-equivalent patch with useful route coverage and recorded validation; current-main overlap does not diminish implementation quality.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored internal refactor is exempt from external-contributor runtime proof; route tests provide supplemental integration validation, with no stored-data contract change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored internal refactor is exempt from external-contributor runtime proof; route tests provide supplemental integration validation, with no stored-data contract change.
Evidence reviewed 7 items Pinned introduced change: The merge-base-to-head patch replaces the local conversion helper and adds two route-test tables; unrelated Control UI endpoint drift is base-branch work.
Equivalent conversion contract: The shared helper truncates finite numbers, stringifies signed zero as zero, trims strings without numeric parsing, and rejects other values. These operations match the original helper. The dependency is an owned workspace package; no Codex contract is involved.
Production overlap on main: Current main contains the identical production change through #164269. REST metadata verifies that PR merged with this commit. Current main still lacks this branch’s 22 added child/parent route cases; the latest supplied release retains the original local helper.
Findings None None.
Security None None.

How this fits together

Channel route projection converts bound conversation references into delivery destinations and thread IDs. Shared normalization prepares those IDs before channel plugins project them or core supplies a fallback.

flowchart TD
 A[Conversation reference] --> B[Normalize channel and IDs]
 B --> C[Channel plugin projection]
 C --> D{Plugin supplies target}
 D --> E[Delivery destination and thread]
 D --> F[Generic target fallback]
 F --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -8, Tests +40. Total +32 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 11 -8
Tests 1 40 0 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 43 11 +32

Review metrics

Metric Value Why it matters
Recorded test cost 29.18 s single-worker wall; 27 s historical CI test step The captured body supplies the explicit measurement requested in the earlier review, without treating full job duration as marginal PR cost.

Technical review

Best possible solution:

Keep main’s canonical conversion owner and preserve useful route-boundary coverage without reintroducing duplicate conversion logic.

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

Not applicable: this PR proposes behavior-preserving cleanup rather than reporting a runtime defect; source inspection supports equivalent conversion semantics.

Is this the best way to solve the issue?

Yes: reusing the existing canonical helper removes duplicate policy, and route-level assertions protect its integration. Main now already contains the production portion.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a33accd27f3d.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This behavior-preserving cleanup and route coverage have no established urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored internal refactor is exempt from external-contributor runtime proof; route tests provide supplemental integration validation, with no stored-data contract change.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch replaces the local conversion helper and adds two route-test tables; unrelated Control UI endpoint drift is base-branch work. (src/utils/conversation-target.ts:19, cdbae6dd74c8)
  • Equivalent conversion contract: The shared helper truncates finite numbers, stringifies signed zero as zero, trims strings without numeric parsing, and rejects other values. These operations match the original helper. The dependency is an owned workspace package; no Codex contract is involved. (packages/normalization-core/src/string-coerce.ts:123, cdbae6dd74c8)
  • Production overlap on main: Current main contains the identical production change through refactor(normalization): deslop string and URL helpers #164269. REST metadata verifies that PR merged with this commit. Current main still lacks this branch’s 22 added child/parent route cases; the latest supplied release retains the original local helper. (src/utils/conversation-target.ts:19, 4fa690195797)
  • Merged overlap verified: GitHub reports the overlapping normalization PR as merged on October 4, 2026, with merge commit 4fa6901. (4fa690195797)
  • Meaningful route-boundary coverage: The tests call the production formatter with explicit expected destinations, distinguish child and parent IDs, and retain existing plugin, generic-fallback, and thread-only cases. They add no production testing seam, timers, process boots, or new worker pin. (src/channels/route-projection.test.ts:90, cdbae6dd74c8)
  • Prior timing follow-up addressed: The captured body and September 25 comment report 26/26 passing tests and 29.18 seconds for the explicit single-worker command, plus 27 CI test-step seconds. REST independently confirms historical CI run 35958615982 succeeded at the exact pinned head. No tests were executed during this read-only review; newer supplied CI failures remain subject to ordinary gates. (src/channels/route-projection.test.ts, cdbae6dd74c8)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-09-18T06:47:55.179Z sha 3ebfd94 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-24T05:16:49.609Z sha cdbae6d :: blocked before merge. :: none
  • reviewed 2026-09-24T05:35:57.580Z sha cdbae6d :: blocked before merge. :: none
  • reviewed 2026-09-24T05:55:04.591Z sha cdbae6d :: blocked before merge. :: none
  • reviewed 2026-09-25T13:50:57.145Z sha cdbae6d :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the refactor/conversation-target-normalization-20260914 branch from 3ebfd94 to cdbae6d Compare September 24, 2026 05:08
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The PR body now records the missing explicit single-worker measurement at unchanged head cdbae6dd74c8d15cbd23a9a1687210cbb2449a3f: 26/26 passed, 29.18 seconds command wall time. The completed Testbox result, source-pin checks, prior CI seconds, and cleanup distinction are documented there. Review only; no repair or automerge requested.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Integrate main after the normalization owner landed in #164269. The remaining contribution is 22 route-level normalization cases; production matches main. Preserve the original PR ancestry and historical proof. Current-head review and hosted CI remain required before landing.
@vincentkoc vincentkoc changed the title refactor(channels): reuse conversation ID normalization chore(channels): cover conversation ID normalization at the route boundary Oct 16, 2026
@vincentkoc
vincentkoc merged commit 790ceff into main Oct 16, 2026
127 of 128 checks passed
@vincentkoc
vincentkoc deleted the refactor/conversation-target-normalization-20260914 branch October 16, 2026 04:33
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
)

* refactor(channels): reuse conversation id normalization

* chore(channels): retain route normalization coverage on current main

Integrate main after the normalization owner landed in openclaw#164269. The remaining contribution is 22 route-level normalization cases; production matches main. Preserve the original PR ancestry and historical proof. Current-head review and hosted CI remain required before landing.

Co-authored-by: Vincent Koc <[email protected]>
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant