Repository navigation
fix: path set resets numbers to zero for blank values - #178692
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
|
Codex review: needs real behavior proof before merge. What this changesReject blank numeric replacements in path edits before writing the file. Example: Run openclaw path set oc://settings.json/retries "" against {"retries":3}.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: current main still permits silent blank-to-zero overwrites, and this PR provides a focused shared-owner repair with no identified code defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe optional oc-path plugin passes CLI replacement text through type-directed JSONC/JSONL coercion, then writes the edited bytes only after successful validation. flowchart TD
A[Path set CLI] --> B[Load structured file]
B --> C[Resolve existing leaf]
C --> D[Shared numeric coercion]
D --> E[Reject blank input]
D --> F[Write valid replacement]
Technical reviewBest possible solution: Keep blank-input rejection in the existing shared coercion owner and preserve the CLI's unchanged-file refusal contract. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the blank-to-zero conversion through the shipped CLI's write path; this read-only review executed no target code. Is this the best way to solve the issue? The one-expression repair fixes the shared JSONC/JSONL producer without adding a parallel validator or narrowing accepted nonblank numeric syntax. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7d0c51217491. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 2:18 PM ET / 18:18 UTC (Revision 2). |
…penclaw#184142) * test(memory): define paired embedding prefix contract * fix(memory): format Nemotron inputs and refresh aliased vectors * test(memory): narrow the embedding fixture provider * fix(memory): honor explicit document formats in Gemini * fix(memory): distinguish explicit raw document identity * fix(memory): preserve vectors when adopting Ollama digests
…4775) sortAndLimitSessionEntries used compareSessionEntryPairs as its comparator, which derived pin and timestamp facts on every comparison and allocated a lazily built pinnable set and closure for each list. The sort now computes each entry's timestamp and effective pin once per list into typed arrays, sorts indices, and maps back. Ordering, including ties, pins and activity sorting, is unchanged. compareSessionEntryPairs loses its optional pinnable callback. Evidence, 11 interleaved pairs: sort-path allocation 12,291 -> 10,845 bytes/list (-11.8%, 9/11 better); whole-list allocation flat; CPU inconclusive. The warm benchmark reuses cached selections, so the live effect is likely larger but unproven. 17 focused tests pass. Runtime +3 LOC.
Register the documented session-actor receipt measurement as an exact Knip entry so unused-file analysis recognizes the maintained command without altering runtime behavior.
…kends, and session jobs can't yield (openclaw#183987) * fix(cron): scheduled runs take their automations scope and requester yield from the execution context Scheduled occurrences on embedded and CLI runtimes read the automations scope from context.toolPolicy.automations: the tool is restricted to the run's own job (status, list, get, remove, runs), and a run with no scope gets none. The CLI loopback now carries that self scope, which replaces the automations denial 0d5.10 left on scheduled CLI runs. A self-and-parent-wake scope offers the same self actions; the parent wake action is a follow-up. sessions_yield is refused for every scheduled placement, so session: jobs match isolated ones. The exec target pin also reads from the context. Ingress turns keep their existing CLI surface and yield. Refs openclaw#178812 * fix(cron): session-target runs keep sessions_yield listed and refuse the call A session: run shares its session's tool catalog, and CLI backends hash that catalog for native session reuse, so the definition stays listed and the scheduled callback refuses the call. Child and detached runs still get no sessions_yield. Adds coverage that a CLI run's retained self-scoped automations tool refuses its own job's removal once the run closes, including a close during an awaited Gateway call. * fix(agents): keep the scheduled exec pin on its existing tool-policy source The context copies the same stored exec target, so reading it there changed nothing; keep the existing source until a consumer needs the context's pin. * test(cron): CLI self-removal through the real Gateway cron handler A scheduled CLI run's self-scoped automations tool removes its own job through the in-process Gateway dispatch and cron.remove handler, and the job stays when the run settles while the removal awaits the store. * test(cron): pin the self-and-parent-wake scope to self actions; name session-job losses in Doctor The context can name a parent wake for an owner child, but the wake action is deferred to the automations wake design; a test pins that both runtimes offer own-job self actions only. Doctor's access review describes the CLI automations narrowing and the sessions_yield loss for session-target jobs, under a heading that no longer attributes every loss to creator authority. * test(cron): CLI self-removal settles against the real cron service and store The scheduled CLI run's automations tool removes its own job through the real Gateway cron handlers, CronService and store. When the run settles while the service's removal is held before persistence, the removal is refused and the stored job is unchanged.
…penclaw#184120) Sanitize completion installation status paths and suppress unsafe shell reload hints while preserving literal profile writes and ordinary shell commands. Validation: the regression fails on base and all 30 runtime tests plus 13 CLI consumer tests pass on the reviewed head. Targeted lint/format and exact-head CI pass. Co-authored-by: Alix-007 <[email protected]>
…claw#184157) * fix(sessions): preserve agent transcript IDs across automatic resets Append the existing reset boundary at admitted command persistence so idle and daily resets keep historical messages indexed. Preserve terminal recovery rotation and explicit session-ID resume behavior. Co-authored-by: SeungTaek Lim <[email protected]> * fix(sessions): preserve Gateway automatic reset boundaries Keep the durable transcript ID through Gateway agent preparation, share reset metadata cleanup, and commit the boundary with the renewed lifecycle. Preserve the triggering RPC source during cleanup and the ended transcript window for hooks. Co-authored-by: SeungTaek Lim <[email protected]> * fix(sessions): preserve reset consumer contracts Keep Gateway explicit-ID expiry semantics while preserving transcript IDs. Align voice and Gateway consumer assertions, adapt the in-memory lifecycle fixture, and retain the original patch accessor binding used by restart-settlement tests. * test(gateway): decouple accessor fixture types Define the fixture dependency surface from the accessor contracts instead of importing its parent mock module. This removes the type-only import cycle without changing fixture execution or production code. --------- Co-authored-by: SeungTaek Lim <[email protected]>
…claw#184842) Transfer the fresh scanner result map to reconciliation, reuse tracked path membership, and avoid repeated logical-path lookups on unchanged files. Preserve failed-read retries and cached directory fingerprints.
…w#176941) Prevent the replacement Stop button from accepting an accidental second Send tap for its first 700 ms, while retaining deliberate cancellation and the existing abort owner. Preserve the shared native composer path, view-bound task cancellation/reset and voice-note behavior. Existing native production-timing red/green proof is retained; the web Control UI is unchanged. Co-authored-by: Solvely-Colin <[email protected]> Co-authored-by: Marvinthebored <[email protected]>
…nclaw#184672) Keep accepted workspace preparation pending during temporary source contention, sharing the existing wait budget through checkout and final session binding without repeating setup. Fixes openclaw#184272.
…claw#183770) Load private conversations in native macOS chat through the existing private session-entry document route instead of the public conversation document. Preserve canonical mounted return paths, escaped drafts, authentication and native draft/focus ownership. Validation: five exact-blob Foundation route tests, SwiftLint and repository-pinned SwiftFormat pass; exact-head CI 40257600942 is green. Signed contributor native evidence shows the baseline unavailable document and the final WebView receiving a fresh synthetic chat.inject message. This maintenance pass did not relaunch the native session. Co-authored-by: pstarkgit <[email protected]>
…penclaw#184754) * perf(ui): trim Settings search dependencies Move shared Memory keys into config sections and register only shared session labels for Settings targets, preserving the full catalog order and synchronous registration. * test(ui): measure native Settings root cold loads * perf(ui): keep Settings search out of optional session chunk Share the dependency-free dedupe helper through the existing boot group and keep shared session English copy with the existing English group. Settings retains its search labels without evaluating optional session UI. * test(ui): await lazy chat details before assertions
|
🦞👀 Re-review progress:
|
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
/allow-security-sensitive-change |
|
Merged via squash.
|
Reject blank numeric path values without converting them to zero. Regression tests cover the original defect and expected supported behavior. Co-authored-by: LinzeShi <[email protected]>
Reject blank numeric path values without converting them to zero. Regression tests cover the original defect and expected supported behavior. Co-authored-by: LinzeShi <[email protected]> (cherry picked from commit 2944740) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 298cb55f8ea6792c3dcd1927e7bb8340b6198bb7)
Reject blank numeric path values without converting them to zero. Regression tests cover the original defect and expected supported behavior. Co-authored-by: LinzeShi <[email protected]> Beta.5 baseline adaptation: Retain the native beta.5 owners, fixtures and public contracts; add focused regression controls and bounded fixture extraction; apply checkout formatting. (cherry picked from commit 2944740) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 2714b9a708411ecdacc6181251a35a517eaed7e3)
What Problem This Solves
Fixes: an empty or whitespace-only numeric replacement in
openclaw path setsilently overwrites the existing number with zero.User Impact
Blank numeric replacements return
parse-error, exit unsuccessfully, and leave the file unchanged. An explicit0still writes zero; valid numeric syntax and empty string fields retain their behavior.Why This Change Was Made
JavaScript converts blank text to zero. Classify blank input as nonnumeric in the shared numeric coercion owner and reuse its existing finite-number rejection. The CLI regressions cover JSONC and JSONL at the file-writing boundary, and the command documentation states how to write zero deliberately.
Thanks @LinzeShi for the original repair and before/after CLI evidence. The original contributor commit is preserved.
Evidence
0dc12b926cf8a9e3fc693e6fc472fc1c7d4d61a5: empty/whitespace input for JSONC/JSONL exits successfully and writes zero. The repaired tests assert exit 1, the existing structured error, and unchanged bytes.9df3c4085c9330c15491bf1d62d87cd572834c05passes all 123 CLI and universal tests with one worker. Numeric controls include0,1e2,0x10,1., and padded2.Retained contributor capture: clean Windows base
63444538b5d8versus clean fixed commit5f19fd19c904, Node 24.19.0, isolated home/config/state and disposable files. Both build stamps matched their heads withinputsClean: true. Final-head regression results are listed above.Captured CLI reproduction and output
Each case starts from this file:
{"retries":3,"label":"keep"}The reproduction launches the standard CLI through pnpm. An argv array preserves the actual empty string on Windows:
JSONL uses
oc://settings.jsonl/L1/retries. The whitespace case passes" \t "as the replacement.Base stdout (only the temporary path is normalized):
{ "ok": true, "dryRun": false, "bytesWritten": 29, "fsPath": "<fixture>/settings.json" }Base exit code:
0. File afterward:{"retries":0,"label":"keep"}Fixed stdout:
{ "ok": false, "reason": "parse-error", "detail": "cannot coerce \"\" to number" }Fixed exit code:
1. File afterward, byte-for-byte identical to the original:{"retries":3,"label":"keep"}Focused test command:
pnpm test extensions/oc-path/src/oc-path/tests/universal.test.ts --maxWorkers=1Enforced security review still requires a maintainer approval for this head. Its notice flags
src/gateway/tool-resolution-authority.tsin the integrated history.