Repository navigation
Conversation
Command output that shared a NUL frame with the generated completion marker had its trailing whitespace stripped, while the same output in its own frame kept it. Keep the text as received so framing does not change the Evidence. Fixes morluto#4016
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryPreserves trailing whitespace before Rizin’s completion marker instead of trimming it.
Reviews (2) · Last reviewed commit: "test(rizin): throw typed errors and reje..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b33c12bf4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const { manager, started } = await startInjected(injected.spawnProcess, { | ||
| frameTimeoutMs: 1000, | ||
| }); | ||
| expect(started.ok).toBe(true); |
There was a problem hiding this comment.
Throw typed failures before reading
Result values
When startInjected or execute returns Err, these boolean assertions abort with only a generic mismatch, so the typed provider failure is never surfaced and this boundary regression becomes much harder to diagnose. The repository's linked docs/testing.md guidance requires throwing the typed error before reading a successful Result; replace both assertion/fallback pairs with if (!...ok) throw ....error.
AGENTS.md reference: AGENTS.md:L77-L77
Useful? React with 👍 / 👎.
| const run = async (framing: "coalesced" | "framed"): Promise<string> => { | ||
| const injected = createInjectedProcess({ | ||
| onWrite: (text, control) => { | ||
| const marker = /!echo (.+)\n/u.exec(text)?.[1]; |
There was a problem hiding this comment.
Reject unmodeled commands in the protocol fixture
If the manager omits or mangles pad but still writes !echo <marker>, this callback still synthesizes value because it only parses the marker, so the regression passes without exercising the requested command exchange. The test guidance linked by the repository rules requires protocol fixtures to reject unmodeled commands; validate the expected pad command and marker request before replying.
AGENTS.md reference: AGENTS.md:L77-L77
Useful? React with 👍 / 👎.
Adapt #4044 at the shared normal/interrupted frame owner. Preserve the decoded prefix before byte-budget accounting and cover MCP delivery across framing and UTF-8 boundaries. Refs #4016. Co-authored-by: Xander-AJ <[email protected]>
|
Thanks @Xander-AJ. Closing this PR as superseded by d5fc7e6eb on Rizin command framing now preserves trailing whitespace before the correlated completion marker. Main owns frame parsing and the supplied coverage. This is an unmerged closure: it does not label this PR as merged or remove contributor history/credit. The decision uses the current source diff and existing validation record; no new local test or provider run is claimed. |
Summary
Fixes #4016.
rizin_debug_commandremoved trailing spaces and a newline from command output when the output and the generated completion marker arrived in one NUL frame, while the same output ending in its own frame was kept. Both results reported complete, untruncated output.Problem and expected behavior
Trigger: Rizin writes
value \n<marker>\n\0(coalesced) instead ofvalue \n\0<marker>\n\0(framed).waitForCommandFramesrantrimEnd()over the text before the marker, so the coalesced run returned"value"and the framed run returned"value \n". The same command output should give the same Evidence regardless of how the provider frames it.Change and scope
Only the text before the marker is no longer trimmed (
src/rizin/RizinDebugSessionManager.ts). Nothing else in marker handling, truncation or limits changes. Not included: any change to how frames are joined.Contract and boundary impact
waitForCommandFrames).rizin_debug_commandoutput may now keep trailing whitespace it previously dropped when coalesced.Expected effects:
Evidence and regression coverage
tests/boundary/providers/RizinDebugSessionCoverage.part4.test.tsruns the same output framed and coalesced and requires identical results.expected 'value' to be 'value \n') and passes with the change. Executed against the injected-process fixture; not against a real Rizin.tests/boundary/mcp) were not run becausedistwas not built. History check: thetrimEnd()was added in the large squashed commit 4aa51bf (fix(reverse): reconcile cleanup ownership and mutation diagnostics #2799) with no stated rationale, and no test or doc I found depends on it. The framed path (output and marker in separate frames) never trimmed, so the old behaviour only applied when frames coalesced. Edge case: a coalesced frame that is only whitespace before the marker (for example a stray\n) now yields that whitespace as output instead of being dropped, matching what a standalone whitespace frame already did.Validation performed
npx vitest run tests/boundary/providers/Rizin src/rizin— 10 files passed, 83 tests passed, 21 skipped (Node 24.18.0)npx oxfmt --checkon both changed files — formattednpx oxlinton both changed files — only pre-existing complexity/length warnings inRizinDebugSessionManager.tsCompatibility, safety, and release
Author readiness
Drafted with AI assistance and then reviewed by the human owner, who made the declarations below.
Human owner: @Xander-AJ