guest context: name reachable hosts + a clean host-handoff protocol#11
Merged
Conversation
The guest ~/.claude/CLAUDE.md gave the in-VM agent too little to act on two recurring failure modes: 1. With an egressAllowlist set, egress is default-deny and a request to any unlisted host silently HANGS then times out. The old context only said "network access may be restricted", so the agent kept retrying doomed fetches. The wrapper now emits a per-run line in the `# ccvm session` header naming the EXACT reachable hosts (the resolved EGRESSALLOW plus the always-added api.anthropic.com), and says anything else will hang — don't retry. Open egress emits a short "you can reach any host" line instead. Built from the live EGRESSALLOW var, so no new @token@. 2. Host-only work (unreachable fetches, git fetch/push needing host creds, host-side CI) was handed back ad hoc. ccvm-context.md now documents a "Handing work to the host" protocol: exact commands in a fenced block, one per line, with NO inline `#` comments (they break when pasted into zsh), each command described in prose outside the block. Tests: host.sh asserts the open-egress line; egress.sh (baked 10.0.0.0/8) asserts the locked line names the host + api.anthropic.com. Both green under nix flake check. egress.md documents the agent-awareness behaviour. Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
|
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.
The guest ~/.claude/CLAUDE.md gave the in-VM agent too little to act on two recurring failure modes:
With an egressAllowlist set, egress is default-deny and a request to any unlisted host silently HANGS then times out. The old context only said "network access may be restricted", so the agent kept retrying doomed fetches. The wrapper now emits a per-run line in the
# ccvm sessionheader naming the EXACT reachable hosts (the resolved EGRESSALLOW plus the always-added api.anthropic.com), and says anything else will hang — don't retry. Open egress emits a short "you can reach any host" line instead. Built from the live EGRESSALLOW var, so no new @token@.Host-only work (unreachable fetches, git fetch/push needing host creds, host-side CI) was handed back ad hoc. ccvm-context.md now documents a "Handing work to the host" protocol: exact commands in a fenced block, one per line, with NO inline
#comments (they break when pasted into zsh), each command described in prose outside the block.Tests: host.sh asserts the open-egress line; egress.sh (baked 10.0.0.0/8) asserts the locked line names the host + api.anthropic.com. Both green under nix flake check. egress.md documents the agent-awareness behaviour.
What & why
Checklist
CI runs
nix flake check(host-side guarantees, guest build, shellcheck) automatically. Thefull-boot smoke test (
tests/boot.sh) needs a real VM and is not in CI — so if your changetouches the guest, wrapper, or boot path, you must run it locally on a Nix+KVM box and paste
the result here. (See CLAUDE.md → "Definition of done".)
nix flake checkis green (CI on this PR, or run locally)bash tests/boot.shon a Nix+KVM box — pasted theN passed, M failedline below; or N/A (docs / CI-only change, no guest/wrapper/boot impact)ssh -tt)? Did a humanccvm --shellpass — resize,vim,less, vi-mode — since terminal fidelity isn't automatedCo-authored-by: Claude <noreply@anthropic.com>