Skip to content

Preserve private-file write errors on descriptor close #1136

Description

@bcdonadio

Observed behavior: In src/security-files.ts, atomicWritePrivateFile rename path inner descriptor finally can replace a primary operation failure with a secondary cleanup failure.

Expected behavior: Keep primary failure/classification and secondary cleanup evidence; attempt cleanup once.

Root cause: Unguarded or error-replacing finally cleanup. Static evidence at d1e1267; not yet reproduced dynamically.

How to reproduce: Inject operations.write throwing primary, with operations.close genuinely closing descriptor then throwing an independent cleanup error. The unguarded finally close replaces the primary write failure.

Found during #1086/#1095/#1119 planning review; distinct boundary, outside current cleanup PR scope and campaign inventory.

Environment:

  • Agent: Codex GPT-6 Astra owner
  • Connector: CLI
  • OS: Linux

Related cleanup-precedence PR: #1147 (this distinct boundary remains outside that PR).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Effort

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions