Repository navigation
fix(agents): expose filesystem tool results in Code Mode - #110395
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 1:22 AM ET / 05:22 UTC. Summary PR surface: Source +197, Tests +139, Docs +3. Total +339 across 13 files. Reproducibility: yes. from source and supplied proof: the new Code Mode test exercises the prior failure path by calling the wrapped read tool through Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Accept one documented shared Do we have a high-confidence way to reproduce the issue? Yes, from source and supplied proof: the new Code Mode test exercises the prior failure path by calling the wrapped read tool through Is this the best way to solve the issue? Unclear until maintainers confirm the shared contract boundary. The normalization and schema coverage are a focused fix for the observed Code Mode path, but the best permanent owner for AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 923d92bdd0e3. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +197, Tests +139, Docs +3. Total +339 across 13 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
Review history (1 earlier review cycle)
|
5c9a9fb to
2db3495
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where Code Mode callers reading ordinary files through
tools.callValue("openclaw:core:read", ...)receivedundefined, so file content could not be composed into later calls. The same high-volume workflow also lacked declared result contracts for edits and patch application.Why This Change Was Made
Read now returns a closed, discriminated details union for text, image, truncation, and optional-not-found outcomes after adaptive paging and image normalization. Edit declares explicit changed/no-op variants, while apply_patch declares its added/modified/deleted path summary. Session tool adapters preserve these tool-local TypeBox contracts.
The read return value is an intentional compatibility change for Code Mode. Existing optional-not-found fields remain available, with an additive
kinddiscriminator. Rendered content blocks remain unchanged.AI-assisted. I reviewed the whole result path, callers, renderers, sibling contract pattern, tests, TypeBox behavior, and the Code Mode bridge.
User Impact
Code Mode can now read ordinary file text as a structured value and compose it without dropping to the raw result envelope. It can also branch reliably on edit no-ops versus real changes and inspect apply_patch summaries from the quick index.
Release note: Code Mode filesystem tools now expose structured read, edit, and apply_patch results for composition.
Evidence
5c9a9fb3327bc3241dc83e6efd4452a37b24a88dtools.callValue("openclaw:core:read", ...)round trip and executed-resultValue.Checkcoverage for every read/edit variant plus apply_patch: https://github.com/openclaw/openclaw/actions/runs/29629586159pnpm check:changedpassed core/core-test typechecks, formatting, exhaustive core lint, plugin boundaries, import-cycle checks, and repository guards on the same patch before the conflict-free rebase.