Skip to content

AI Workspace writeFile reports failure after the file landed, when the owed-copy save fails #1285

Description

@Juliusolsson05

This is a residual from #1260 review B (round 2). The reviewer confirmed it, called it non-blocking, and #1260's disposition omitted it (steering q24).

Sequence: the registry owes a preservation copy, and that copy is blocked (for example, a directory occupies the .invalid-<digest>.json path). writeFile succeeds via atomicWriteTextFile, so the user's file on disk is now v2. Then refreshEntriesForPath → save → preserveOwedCopy rejects, and the call returns {ok:false, error:"is a directory"}. An agent that is told "failed" may retry, which converges through the version conflict, or may report a failure to the user that did not happen.

Fix shape: a status-save failure after a successful write must not mask the write. Return ok:true with a warning that the status refresh failed. Also (cosmetic): refusals relay the raw EISDIR text with no hint that clearing the state directory unblocks everything.

Severity: P3.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclass:C3-silent-failureThe app knows it failed and does not saysev:P3Minortype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions