Repository navigation
refactor(ios): reuse shared integer conversion - #139581
Conversation
Use the existing exact numeric accessor for automation and usage models, preserving raw integer strings and missing-value outcomes. Numeric fractions now remain unavailable instead of truncating, consistent with the inspected cron and token producer contracts. The shared accessor and wire schema stay unchanged, and both duplicate numeric switches are removed. Full signed iOS app/test compilation, four ordinary model tests, thirteen changed checks, and independent source reviews pass. Production net -9 LOC.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 5, 2026, 9:54 PM ET / September 6, 2026, 01:54 UTC. ClawSweeper reviewWhat this changesThe iOS automation and usage readers reuse shared exact integer conversion, preserve integer strings and missing values, and expand model-decoding coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused refactor: current main retains both duplicate conversions, and no actionable introduced defect was found. The documented rejection of fractional values agrees with the inspected producer contracts. Priority: P3 Review scores
Verification
How this fits togetherThe iOS app decodes Gateway automation schedules, run timestamps, and usage totals into models used by its automation editor and overview screens. Shared integer conversion determines which numeric values those models can safely display or edit. flowchart LR
A[Gateway automation data] --> C[iOS model readers]
B[Gateway usage totals] --> C
C --> D[Shared exact integer conversion]
C --> E[Integer string parsing]
D --> F[Optional integer values]
E --> F
F --> G[Automation and usage screens]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +25. Total +25 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep numeric conversion with the shared exact accessor and retain model-local integer-string parsing and missing-value handling. Do we have a high-confidence way to reproduce the issue? Not applicable to the refactor itself; the conversion difference is clear from source, but no current-main crash was reproduced or claimed. Is this the best way to solve the issue? Yes. Reusing the existing exact conversion owner removes duplication while the thin adapters preserve integer strings; inspected callers and producer contracts support the intentional fractional-value rejection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8731bc88a7c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* origin/main: fix(cli): keep note text with Windows and Unicode line endings (#139512) fix(agents): keep isolated completion context on its admitted generation (#139607) fix: avoid declaration builds during source-server updates (#139392) fix(models): keep discovered models after catalog refresh failures (#139357) fix(gateway): record a transcript notice when a run fails before replying (#139439) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479)
* commit '6c55a99226ed0611ca088004c81b00fb296f1f71': (182 commits) test(ui): scope dashboard settings setup to the top frame (openclaw#139618) refactor(skills): share pending proposal creation (openclaw#139617) fix(release): accept frozen targets before worker bundles (openclaw#136699) fix(gateway): preserve percent sequences in media filenames (openclaw#139508) fix: preserve current update availability alongside update history (openclaw#139501) feat(diagnostics): expose garbage collection duration metrics (openclaw#139592) fix(ui): keep Logbook timestamps clear of the activity stripe (openclaw#139539) fix(ui): keep Swarm outcomes visible after completion (openclaw#139490) test: check file accessibility without runtime-specific return values (openclaw#139590) refactor(sdk): keep helper types private (openclaw#139601) fix(cron): preserve current-session delivery intent (openclaw#139491) fix: prevent browser profile permission hangs in Doctor (openclaw#139612) fix(agents): repair storage-failure test fixture after failover owner move (openclaw#139531) fix(cli): keep note text with Windows and Unicode line endings (openclaw#139512) fix(agents): keep isolated completion context on its admitted generation (openclaw#139607) fix: avoid declaration builds during source-server updates (openclaw#139392) fix(models): keep discovered models after catalog refresh failures (openclaw#139357) fix(gateway): record a transcript notice when a run fails before replying (openclaw#139439) refactor(ios): reuse shared integer conversion (openclaw#139581) fix(sessions): prevent database lock failures during reclamation (openclaw#139469) ...
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
Use the existing exact numeric accessor for automation and usage models, preserving raw integer strings and missing-value outcomes. Numeric fractions now remain unavailable instead of truncating, consistent with the inspected cron and token producer contracts. The shared accessor and wire schema stay unchanged, and both duplicate numeric switches are removed. Full signed iOS app/test compilation, four ordinary model tests, thirteen changed checks, and independent source reviews pass. Production net -9 LOC.
What Problem This Solves
Automation schedules and usage totals had separate copies of numeric-to-integer conversion, despite an existing shared accessor. Both copies also converted finite floating-point values through a non-failable initializer.
Why This Change Was Made
Use
AnyCodable.intValuein both model readers and retain their small raw integer-string adapters. Numeric conversion stays with its existing shared owner; automation and usage retain their own model and missing-value handling. The two duplicate numeric switches are removed, reducing production code by nine lines.User Impact
Ordinary integer values, integer strings and absent optional values keep their existing behavior. The numeric policy change is explicit: fractional numeric values now yield no value instead of being truncated. Current and stable cron schemas require integers, and the usage producer normalizes token counts before aggregation. Historical Gateway versions and arbitrary old caches are not claimed to be exhaustively compatible.
The shared accessor, Gateway schema, configuration and persistence behavior are unchanged. No visual layout changes.
Evidence
Proof used one new iPhone 17/iOS 26.5 simulator with ad-hoc-signed products. The simulator is deleted; existing simulator and operator state were preserved. Coverage is ordinary model behavior, not a crash or out-of-range reproduction.
Four files: production +3/−12 (−9), tests +43/−9 (+34). Exact-head CI passed: nine jobs succeeded, 24 were skipped, and none failed. The latest exact-head ClawSweeper review has no actionable findings or rank-up requests.