fix(export): preserve explicit trajectory session keys#83308
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-level with high confidence. Current main returns PR rating Rank-up moves:
What the crustacean ranks mean
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. PR egg Rarity: 🥚 common. What is this egg doing here?
Real behavior proof Risk before merge Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this decoder/test fix after maintainer approval, preserve non-empty encoded-value precedence, and then close the linked bug as fixed. Do we have a high-confidence way to reproduce the issue? Yes, source-level with high confidence. Current main returns Is this the best way to solve the issue? Yes. Building the decoded partial only from non-empty encoded strings is the narrow maintainable fix and avoids changing CLI registration, slash-command request generation, or session store lookup semantics. Label justifications:
Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 583eb711ecb1. |
|
@clawsweeper re-review Updated the PR body with real after-fix CLI proof from a WSL OpenClaw source checkout at PR head. The run exercises |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
sessionKeyandstorewhen the encoded request only supplies another optionFixes #83282.
Real behavior proof
Behavior addressed: encoded trajectory export requests that omit
sessionKeyshould not erase an explicit direct--session-key/--storeoption.Real environment tested: WSL Ubuntu OpenClaw source checkout at PR head
978ce2859e5b6df3bfdd4eebfe772f2ddedd29econ branchtmp-pr-83308-proof.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: the CLI kept the explicit direct
--session-keyand--storewhile decoding a partial encoded request that only containedoutput. It reached the expectedSession not found: agent:main:telegram:direct:123path for the empty test store, instead of the pre-fix--session-key is requiredpath.What was not tested: a successful trajectory export against a real stored session transcript; this proof covers the regression path where option merging erased the direct session key before lookup.
Root Cause
sessionKeyeven when the encoded JSON omitted it.Regression Test Plan
src/commands/export-trajectory.test.ts.Validation
CI=1 node scripts/run-vitest.mjs src/commands/export-trajectory.test.tspnpm check:changed