Skip to content

Fix frozen command_id default causing concurrent execution stdout corruption#757

Merged
dines-rl merged 3 commits intomainfrom
dines/fix-uuid-gen-issue
Mar 10, 2026
Merged

Fix frozen command_id default causing concurrent execution stdout corruption#757
dines-rl merged 3 commits intomainfrom
dines/fix-uuid-gen-issue

Conversation

@dines-rl
Copy link
Contributor

@dines-rl dines-rl commented Mar 10, 2026

Summary

  • execute and execute_and_await_completion (both sync and async) used command_id: str = str(uuid7()) as a default parameter — Python evaluates this once at class definition time, so every call without an explicit command_id reused the same frozen UUID
  • When multiple concurrent calls hit the same devbox with the same command_id, the rage agent creates two executions writing to the same output file (/runloop/commands/{uuid}.stdout), producing garbled/interleaved stdout
  • Fix: change the default to None and generate a fresh uuid7() per call in the method body

Root cause chain

  1. SDK: frozen default command_id → all concurrent calls share one UUID
  2. Rage agent: no duplicate command_id guard — HashMap::insert silently overwrites the prior entry
  3. Rage agent: File::create on the same path truncates the existing stdout file while the first process is still writing → interleaved bytes

Test plan

  • SDK unit tests pass (they always pass explicit command_id=)
  • Smoketest CI run with cooperative async concurrency (the scenario that triggered this)

@dines-rl dines-rl changed the title cp dines Fix frozen command_id default causing concurrent execution stdout corruption Mar 10, 2026
Ensures execute() generates a fresh UUIDv7 for each invocation (both sync
and async), and that explicitly passed command_id values are preserved.

Made-with: Cursor
@dines-rl dines-rl requested review from ross-rl and sid-rl March 10, 2026 23:48
Made-with: Cursor
@dines-rl dines-rl force-pushed the dines/fix-uuid-gen-issue branch from 44301a6 to f7bfcb0 Compare March 10, 2026 23:52
@dines-rl dines-rl merged commit c2958c5 into main Mar 10, 2026
7 checks passed
@dines-rl dines-rl deleted the dines/fix-uuid-gen-issue branch March 10, 2026 23:56
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.

3 participants