Skip to content

fix(auth): use atomic writes and error recovery for auth.json (#37)#48

Merged
randomm merged 1 commit intodevfrom
fix/issue-37-auth-atomic-write
Jan 26, 2026
Merged

fix(auth): use atomic writes and error recovery for auth.json (#37)#48
randomm merged 1 commit intodevfrom
fix/issue-37-auth-atomic-write

Conversation

@randomm
Copy link
Owner

@randomm randomm commented Jan 26, 2026

Summary

  • Atomic write pattern (temp file + rename) prevents corruption from interrupted writes
  • Error recovery in all() returns empty dict instead of crashing on corrupt JSON
  • Null check in codex.ts prevents TypeError on undefined auth

Fixes #37

Changes

  • packages/opencode/src/auth/index.ts: atomic writes in set()/remove(), error recovery in all()
  • packages/opencode/src/plugin/codex.ts: null safety check

@github-actions
Copy link

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@randomm randomm merged commit b06c1cf into dev Jan 26, 2026
1 of 3 checks passed
@randomm randomm deleted the fix/issue-37-auth-atomic-write branch January 26, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant