Skip to content

fix(parallel): keep normalized search fields UTF-16 safe#101679

Closed
ly85206559 wants to merge 1 commit into
openclaw:mainfrom
ly85206559:codex/parallel-normalize-utf16
Closed

fix(parallel): keep normalized search fields UTF-16 safe#101679
ly85206559 wants to merge 1 commit into
openclaw:mainfrom
ly85206559:codex/parallel-normalize-utf16

Conversation

@ly85206559

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Parallel search normalization paths that could cut UTF-16 surrogate pairs in half when applying API field limits. The objective, search_queries[], and client_model fields all have hard character caps and previously used raw .slice(...) truncation.

Why This Change Was Made

Recent bounded text fixes use the shared truncateUtf16Safe helper for model-facing and user-provided text. This applies that existing helper to Parallel's request normalization while preserving the same field limits and request shape.

User Impact

Parallel search requests remain well-formed when objectives, search queries, or client model identifiers contain emoji or non-BMP characters near truncation boundaries.

Evidence

  • node scripts/run-vitest.mjs extensions/parallel/src/parallel-web-search-provider.test.ts
    • extensions/parallel/src/parallel-web-search-provider.test.ts passed: 29 tests passed.
  • git diff --check
  • python .agents\skills\autoreview\scripts\autoreview --mode local --no-web-search
    • autoreview clean: no accepted/actionable findings reported
  • Base: latest origin/main at 4e29b2f5ab

@ly85206559
ly85206559 marked this pull request as ready for review July 7, 2026 13:21
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 9:35 AM ET / 13:35 UTC.

Summary
The PR replaces raw Parallel objective, search query, and client model truncation with the shared UTF-16-safe helper and adds surrogate-boundary regression tests.

PR surface: Source +1, Tests +16. Total +17 across 2 files.

Reproducibility: yes. A current-main Node check reproduces the raw-slice surrogate split, and current source uses that same raw slice in the Parallel normalizer.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix proof from a real Parallel provider run, request transcript, logs, or terminal output, with API keys, IPs, private endpoints, phone numbers, and other private details removed.
  • Update the PR body after adding proof so ClawSweeper re-reviews automatically; if it does not, ask a maintainer to comment @clawsweeper re-review.
  • Refresh the branch against current main so exact-head CI/review runs after the proof update.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only unit/static validation is present; the contributor should add redacted real Parallel provider proof such as terminal output, logs, or a request transcript after the fix. 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.

Risk before merge

  • [P1] The remaining merge blocker is evidence quality: the PR body lists unit/static checks, but no redacted after-fix Parallel provider run, request transcript, logs, or terminal output.
  • [P1] GitHub reports the PR as behind current main; the touched Parallel files did not drift from the PR base to current main, but exact-head CI/review should still refresh before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the focused shared-normalizer fix and merge it after redacted real behavior proof plus refreshed exact-head checks confirm the Parallel provider path works.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No automated repair is needed because no code defect was found; the remaining blocker is contributor real behavior proof plus normal merge refresh.

Security
Cleared: The diff only swaps to an existing SDK text helper and adds tests; it does not change dependencies, credentials, CI, install scripts, or other security-sensitive surfaces.

Review details

Best possible solution:

Keep the focused shared-normalizer fix and merge it after redacted real behavior proof plus refreshed exact-head checks confirm the Parallel provider path works.

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

Yes. A current-main Node check reproduces the raw-slice surrogate split, and current source uses that same raw slice in the Parallel normalizer.

Is this the best way to solve the issue?

Yes. Using the existing shared UTF-16-safe helper at the shared Parallel normalizer is the narrowest maintainable fix; schema-only or transport-specific changes would leave runtime duplication or one provider path unfixed.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR fixes a bounded UTF-16 normalization defect in the Parallel web-search provider with limited blast radius to non-BMP text near field limits.
  • 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: Only unit/static validation is present; the contributor should add redacted real Parallel provider proof such as terminal output, logs, or a request transcript after the fix. 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

PR surface:

Source +1, Tests +16. Total +17 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 3 +1
Tests 1 16 0 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 3 +17

What I checked:

Likely related people:

  • steipete: Git blame points the current Parallel normalizer and shared UTF-16 helper export to commit 6e792f0, whose live merged PR metadata identifies steipete as author and merger; the path history is otherwise thin in this checkout. (role: introduced current implementation / recent area contributor; confidence: medium; commits: 6e792f08f88f; files: extensions/parallel/src/parallel-search-normalize.ts, packages/normalization-core/src/utf16-slice.ts, src/plugin-sdk/text-utility-runtime.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-07T13:27:02.566Z sha a6fe951 :: needs real behavior proof before merge. :: none

@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. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Superseded by #101711, now landed as 87fe266c5e4d790e8f15278ecc417d3a4d418b91.

The landed implementation keeps both Parallel request runtimes on the shared Plugin SDK UTF-16-safe boundary, preserves the existing field limits, and includes the focused tests plus a live keyless Parallel Search MCP request. Exact-head CI, full check:changed, and autoreview all passed.

Thanks @ly85206559 for identifying and fixing this boundary.

@steipete steipete closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: parallel P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS 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.

2 participants