Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Problem

File edit tool calls that fail with WRITE DENIED errors are displayed expanded by default. These errors happen frequently during normal operation (when a file is modified between read and write) and don't require immediate attention, making the expanded state noisy.

Solution

Modified FileEditToolCall to detect WRITE DENIED errors via prefix match and start them in collapsed state. Other errors and successful edits remain expanded as before.

Users can still manually expand WRITE DENIED errors if they want to see the details.

Testing

  • Type checking passes
  • Logic is straightforward: check error prefix and set initial expansion state

Generated with cmux

File edit operations that fail with WRITE DENIED errors are common and
expected (e.g., when a file is modified between read and write). These
errors no longer warrant expanding the tool call by default.

Changes:
- FileEditToolCall now detects WRITE DENIED errors via prefix check
- WRITE DENIED errors start collapsed (can still be manually expanded)
- Other errors and successful edits remain expanded as before
Also updated AGENTS.md to remind future agents to search for existing
constants before defining new ones.
@ammario ammario enabled auto-merge October 24, 2025 00:43
@ammario ammario disabled auto-merge October 24, 2025 00:43
Frontend cannot import from services/ due to import restrictions.
Duplicated the constant in src/constants/ui.ts with a comment noting
it must stay in sync with the backend definition.
Instead of duplicating the constant between backend (services/tools/fileCommon.ts)
and frontend (constants/ui.ts), moved it to src/types/tools.ts which is already
used as a shared location for tool-related types and constants.

Updated all imports across:
- Backend: file_edit_operation.ts, file_edit_insert.ts, file_edit_operation.test.ts
- Frontend: FileEditToolCall.tsx
- Removed duplicate from constants/ui.ts
- Left comment in fileCommon.ts noting the move

Also updated AGENTS.md with one sentence to prevent this class of mistake:
when a constant exists in a layer-specific location but is needed across
layers, move it to a shared location rather than duplicating it.
@ammario ammario added this pull request to the merge queue Oct 24, 2025
Merged via the queue into main with commit 07b5d7b Oct 24, 2025
15 checks passed
@ammario ammario deleted the save-large-hunk-expand-state branch October 24, 2025 01:12
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.

2 participants