Skip to content

fix(protocol): prevent stdin inheritance in exec child processes#368

Merged
0xLeif merged 1 commit intomainfrom
fix/exec-stdin-null
May 6, 2026
Merged

fix(protocol): prevent stdin inheritance in exec child processes#368
0xLeif merged 1 commit intomainfrom
fix/exec-stdin-null

Conversation

@corvid-agent
Copy link
Copy Markdown
Collaborator

Summary

  • Exec'd child processes inherited the parent's stdin, causing nested plugin invocations (e.g., fledge memory save calling fledge sql query internally) to race on the same pipe and drop messages after ~4 sequential execs.
  • Fix: set stdin(Stdio::null()) on exec child spawns. Exec commands receive input via their command string, not stdin — they should never inherit the plugin protocol pipe.
  • Not a breaking change — no existing plugin reads from stdin in an exec'd process.

Test plan

  • cargo build — compiles cleanly
  • cargo test — all 23 tests pass
  • cargo clippy -- -D warnings — no warnings
  • Manual: fledge memory save --key test --value hello (triggers nested fledge sql migrate + fledge sql query)

🤖 Generated with Claude Code

@corvid-agent corvid-agent requested a review from a team as a code owner May 6, 2026 14:51
github-actions[bot]
github-actions Bot previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Corvin says...

      _
    <(^\  .oO(Caw! ^v^)
     |/(\
      \(\\
      " "\\

"Looking sharp! Like a beak should be."

CI Summary

Check Status
Dependency Audit ✅ Passed
Lint (fmt + clippy) ✅ Passed
Spec Validation ✅ Passed
Tests (3 OS) ✅ Passed

Powered by corvid-pet

@corvid-agent
Copy link
Copy Markdown
Collaborator Author

👋 CorvidAgent is looking into this.

@corvid-agent
Copy link
Copy Markdown
Collaborator Author

CI all green — thanks Corvin! 🪶 Ready to merge whenever Leif gives the nod.

@corvid-agent
Copy link
Copy Markdown
Collaborator Author

👋 CorvidAgent is looking into this.

1 similar comment
@corvid-agent
Copy link
Copy Markdown
Collaborator Author

👋 CorvidAgent is looking into this.

Exec'd child processes inherited the parent's stdin file descriptor,
which caused nested plugin invocations (e.g., memory calling sql) to
race on the same pipe—dropping messages after ~4 sequential execs.
Setting stdin to Stdio::null() breaks the inheritance chain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0xLeif 0xLeif force-pushed the fix/exec-stdin-null branch from 75d6640 to 105ad7e Compare May 6, 2026 22:07
@github-actions github-actions Bot dismissed their stale review May 6, 2026 22:11

Superseded by updated review.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Corvin says...

      _
    <(^\  .oO(Caw! ^v^)
     |/(\
      \(\\
      " "\\

"Caw! Found a shiny new spec!"

CI Summary

Check Status
Dependency Audit ✅ Passed
Lint (fmt + clippy) ✅ Passed
Spec Validation ✅ Passed
Tests (3 OS) ✅ Passed

Powered by corvid-pet

@0xLeif 0xLeif merged commit 397532c into main May 6, 2026
9 checks passed
@0xLeif 0xLeif deleted the fix/exec-stdin-null branch May 6, 2026 22:11
@corvid-agent
Copy link
Copy Markdown
Collaborator Author

👋 CorvidAgent is looking into this.

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.

2 participants