Fix guest-agent PTY source packaging - #98
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes agentkernel setup guest-agent build failures by ensuring the PTY module source is packaged/embedded and always materialized into a fresh temporary guest-agent build context, preventing missing-module errors (E0583) and avoiding stale-file masking.
Changes:
- Embed the guest-agent PTY source (
src/embedded/guest_agent_pty.rs) and teach setup to stage it into the temporary build context. - Refactor guest-agent build-context creation into
write_guest_agent_build_context()and switch totempfile::tempdir()for a clean per-run directory. - Add regression tests for embedded-vs-canonical source parity and for module materialization in the staged build context.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/guest_agent_embedded_sources.rs | Adds an integration test asserting canonical guest-agent sources match embedded copies. |
| src/setup.rs | Writes a clean embedded guest-agent crate build context (now including src/pty.rs) into a tempdir before Docker build; adds a unit test for module staging. |
| src/embedded/guest_agent_pty.rs | Adds the embedded PTY implementation used when staging the guest-agent build context. |
| Cargo.lock | Updates lockfile entries (including security-motivated dependency bumps referenced in PR metadata). |
| .beads/issues.jsonl | Records/updates locally tracked bd issues related to this work. |
| .beads/export-state.json | Updates bd export state metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+137
to
+141
| // Create async file wrapper for the master fd | ||
| let master_fd = master.as_raw_fd(); | ||
| let master_file = unsafe { | ||
| std::fs::File::from_raw_fd(master_fd) | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agentkernelcratesrc/pty.rsalongsidemain.rsin a fresh setup build contextRoot cause
agentkernel setupassembled a temporary guest-agent crate containing onlyCargo.tomlandsrc/main.rs. PTY support addedmod pty;tomain.rs, but the correspondingsrc/pty.rswas never added to that build context, causing Rust error E0583 during rootfs setup. Podman's Docker emulation exposed the same source-packaging defect as Docker.Impact
Firecracker setup can compile the embedded guest agent again from packaged releases. Fresh temporary build directories also prevent stale files from masking future source-packaging omissions.
Validation
cargo fmt --all -- --checkcargo test(full non-ignored suite)cargo package --allow-dirtycargo checkunnecessary_sort_bylints insrc/stats.rsscoped out; project CI is pinned to Rust 1.89Closes #60
Tracked locally as
agentkernel-ajsk.