Skip to content

fix(crestodian): use truncateUtf16Safe for config get output truncation#102723

Closed
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/utf16-safe-crestodian-ops
Closed

fix(crestodian): use truncateUtf16Safe for config get output truncation#102723
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/utf16-safe-crestodian-ops

Conversation

@zhangqueping

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Crestodian operations module uses a raw UTF-16 code-unit slice to truncate config-get output values. An emoji crossing the boundary could produce an unpaired surrogate in diagnostic messages.

Files Changed

File Change
src/crestodian/operations.ts Replace .slice(0,N) with truncateUtf16Safe in config-get output truncation.
🤖 Generated with Claude Code

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 9, 2026
@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

Summary
The PR replaces Crestodian config-get output truncation from rendered.slice(...) to the shared truncateUtf16Safe helper.

PR surface: Source +1. Total +1 across 1 file.

Reproducibility: yes. source-level. Current main slices rendered config-get output at a fixed UTF-16 code-unit boundary, so a JSON-rendered value with an emoji high surrogate at the cutoff can produce a dangling surrogate; I did not execute a live run in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof 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 real behavior proof from a Crestodian or config-get run where a long emoji-containing value is truncated safely.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix real behavior proof is present; a redacted terminal transcript, copied live output, or logs from a Crestodian/config-get run would satisfy this gate if private paths, tokens, endpoints, and other sensitive details are redacted. 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 PR lacks contributor-supplied real behavior proof, so reviewers have source-level confidence but no observed after-fix Crestodian/config-get run from a user-like setup.

Maintainer options:

  1. Decide the mitigation before merge
    Use the shared UTF-16-safe truncator for this config-get diagnostic path and add redacted real terminal/log proof showing a long emoji-containing value truncates without a dangling surrogate.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Contributor-supplied real behavior proof is missing, so the next action is proof and normal review rather than an automated repair PR.

Security
Cleared: The diff only imports an existing workspace normalization helper and changes diagnostic log truncation; it adds no dependency, workflow, credential, permission, or code-execution surface.

Review details

Best possible solution:

Use the shared UTF-16-safe truncator for this config-get diagnostic path and add redacted real terminal/log proof showing a long emoji-containing value truncates without a dangling surrogate.

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

Yes, source-level. Current main slices rendered config-get output at a fixed UTF-16 code-unit boundary, so a JSON-rendered value with an emoji high surrogate at the cutoff can produce a dangling surrogate; I did not execute a live run in this read-only review.

Is this the best way to solve the issue?

Yes for the production code. Reusing the existing shared UTF-16 truncator is the narrow maintainable fix for this output path; the remaining gap is proof, not a different implementation layer.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority diagnostic-output correctness fix with limited blast radius to Crestodian config reads.
  • 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: No after-fix real behavior proof is present; a redacted terminal transcript, copied live output, or logs from a Crestodian/config-get run would satisfy this gate if private paths, tokens, endpoints, and other sensitive details are redacted. 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:

  • P2: This is a normal-priority diagnostic-output correctness fix with limited blast radius to Crestodian config reads.
  • 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: No after-fix real behavior proof is present; a redacted terminal transcript, copied live output, or logs from a Crestodian/config-get run would satisfy this gate if private paths, tokens, endpoints, and other sensitive details are redacted. 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. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
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 1 2 1 +1

What I checked:

Likely related people:

  • steipete: Authored and merged the large Crestodian conversational onboarding work that added config get/schema read operations to the ring-zero setup flow and repeatedly touched src/crestodian/operations.ts. (role: feature owner and recent area contributor; confidence: high; commits: 4c588811f312, ecb9090ec43a; files: src/crestodian/operations.ts, src/crestodian/chat-engine.ts, src/agents/tools/crestodian-tool.ts)
  • fuller-stack-dev: Authored the merged providerless Crestodian model-setup work that recently modified src/crestodian/operations.ts and adjacent Crestodian setup paths. (role: recent adjacent contributor; confidence: medium; commits: 2520edab4ce1; files: src/crestodian/operations.ts, src/crestodian/chat-engine.ts, src/agents/tools/crestodian-tool.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.

@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 9, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks @zhangqueping. #102823 landed the same UTF-16-safe Crestodian config-output cap in 5ef269c, preserving the existing cap and marker behavior. This branch is fully superseded, so I’m closing it.

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

Labels

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. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants