fix(a2a): add cross-platform atomic write safety & handle Windows chm… - #85
fix(a2a): add cross-platform atomic write safety & handle Windows chm…#85Adityakk9031 wants to merge 1 commit into
Conversation
…od permission errors
|
@dimavrem22 and @alex-w-99 have a look |
thanks @Adityakk9031 to help us review the prs, can you please let us know the agent handle of the identity you're using. Thanks mate |
|
@dimavrem22 Thanks I used OpenCode together with Codex as coding assistants for this PR. I reviewed and finalized the changes before submitting. |
no i mean your inkbox agent handle |
|
@dimavrem22 Ah got it, thanks for clarifying! My Inkbox agent handle is |
nice! How'd you run into this issue out of curiosity? did you run A2A on a windows? Im thinking of ways to harden the code against issues like this in the future |
|
Thanks @dimavrem22! Yes, exactly I was running the plugin and running test suites on a Windows machine. On Windows/NTFS, POSIX Adding cross-platform CI matrix testing ( |
Fixes #84
Summary
Fixes an issue in
a2a_context.pywhere_atomic_writeraised unhandledOSError/PermissionErroron Windows environments duringchmod(0o600)calls, and left temporary.tmpcontext files dangling when atomic writes were interrupted.Problem
chmod(0o600)) throwOSError/PermissionErroron Windows or non-POSIX file systems._atomic_writefailed prior toos.replace, the.tmpfile was left in the state directory, causing subsequentos.replacecalls to fail withPermissionErroror file lock conflicts.Fix Applied
chmod(0o600)calls incontextlib.suppress(OSError)so file creation succeeds across Windows and non-POSIX environments.finallyblock in_atomic_writeto safely unlink any leftover.tmpfile on failure.encoding="utf-8"when writing JSON context files.Verification