Skip to content

fix: report Agent file mutation failures - #48

Open
dvd233 wants to merge 1 commit into
MiniMax-AI:mainfrom
dvd233:codex/fix-storage-tool-errors
Open

dvd233 wants to merge 1 commit into
MiniMax-AI:mainfrom
dvd233:codex/fix-storage-tool-errors

Conversation

@dvd233

@dvd233 dvd233 commented Oct 9, 2026 •

Copy link
Copy Markdown

Summary

file_write and file_delete currently report success even when storage responds with an HTTP error or the request fails. The Agent then receives that false success in its next model request.

Changes

  • Add opt-in failure propagation to the existing storage write/delete methods and enable it for these two Agent tools. Other callers retain their current best-effort behavior.
  • Preserve successful output, request data, and batching. Failed mutations are not automatically retried.
  • Add 16 module regression tests and six browser tests covering HTTP failures, network failures, and success through the conversation loop.

Validation

  • Before the fix: eight fault-injection assertions fail because the tools return success; eight controls pass.
  • After the fix: all 127 unit tests and the default coverage check pass. Modified executable statements are fully covered; modified-line branch entries are 15/16 covered (93.75%).
  • A separate whole-file coverage probe including every storage/fileTools helper falls below the global thresholds; the figures above describe the modified lines, not whole-file coverage.
  • Six Chromium tests pass with synthetic API responses; the next model request receives the tool result. No live provider, account credentials, or real storage mutations are used.
  • Full ESLint check, formatting, and git diff --check pass.
  • Production build passes on Windows with Git Bash as the process-local script shell and pnpm build --env-mode=loose. Plain pnpm build cannot execute the existing POSIX NODE_ENV=production script in Windows cmd.exe.

Related Issues

Closes #47.

Checklist

  • pnpm run lint passes (same ESLint invocation, without automatic fixes)
  • pnpm build passes (Windows shell wrapper described above)
  • Documentation updated if applicable (tool schemas and successful outputs are unchanged)
  • Self-reviewed the code changes
  • AI code review passed (auto-triggered on PR)

AI assistance was used for diagnosis, implementation, and test development.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Agent file_write and file_delete report success when storage requests fail

1 participant