Skip to content

fix(proxy): self-renew GitHub access - #8

Merged
foobarto merged 1 commit into
mainfrom
agent/proxy-self-renewal
Aug 15, 2026
Merged

fix(proxy): self-renew GitHub access#8
foobarto merged 1 commit into
mainfrom
agent/proxy-self-renewal

Conversation

@foobarto

Copy link
Copy Markdown
Owner

Summary

  • move short-lived GitHub proxy capability renewal into the long-lived host proxy daemon
  • add devbox proxy refresh, independent of project manifest and image resolution
  • route Homebrew's public and common absolute gh path through the managed wrapper under --proxy
  • restore Homebrew's normal gh link under --no-auth
  • prepare the v1.2.1 patch release

Root cause

Capability renewal was owned by the interactive devbox process, so it stopped when that terminal exited. Homebrew's public gh path also remained directly executable, allowing an agent that selected the absolute path to bypass the wrapper accidentally.

Impact

Registered running boxes now receive renewed proxy capabilities from the host daemon every seven hours, with one-minute checks after suspend or idle. Refreshes do not parse .devbox.toml, build an image, start a stopped box, or restart a running VM. Under --proxy, the normal Homebrew gh entry point resolves to the managed wrapper.

Validation

  • make test — 88 Bats tests and 38 Python tests
  • make lint
  • git diff --check
  • Gitleaks candidate, staged, and history scans
  • live capability renewal and absolute-Homebrew-path smoke tests in two already-running boxes; VM boot IDs remained unchanged

Copilot AI lite review requested due to automatic review settings August 15, 2026 12:57
@foobarto
foobarto marked this pull request as ready for review August 15, 2026 12:57
@foobarto
foobarto merged commit 7dcfa63 into main Aug 15, 2026
1 check passed
@foobarto
foobarto deleted the agent/proxy-self-renewal branch August 15, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR moves GitHub proxy-capability renewal from the short-lived interactive devbox process into the long-lived host proxy daemon, adds a manifest-independent devbox proxy refresh command, and hardens gh routing under --proxy by ensuring Homebrew’s public gh entry point goes through the managed wrapper.

Changes:

  • Add daemon-side GitHub capability renewal based on host-owned box registrations, plus a --refresh-gh-proxy-boxes control path and devbox proxy refresh CLI plumbing.
  • Route Homebrew’s public bin/gh to the managed wrapper under --proxy, while keeping a private gh-real for the wrapper; restore Homebrew’s link under --no-auth.
  • Update docs/tests and bump version to v1.2.1.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
VERSION Bump version to 1.2.1.
test/proxy_test.py Add unit tests for daemon renewal, capability delivery stdin usage, NDJSON parsing, and wrapper real-binary preference.
test/devbox.bats Update proxy wiring assertions; add test ensuring proxy refresh bypasses project resolution.
README.md Document devbox proxy refresh and new daemon-driven renewal + gh routing behavior.
proxy/README.md Expand proxy design docs for daemon renewal and Homebrew gh routing changes.
proxy/gh-wrapper.py Prefer managed private gh-real if present/executable.
proxy/devbox-ai-proxy.py Implement registered-box scanning, renewal scheduling, refresh command, and health marker update.
docs/agent-capabilities-security.md Document renewal + gh routing and clarify non-boundary properties.
CHANGELOG.md Add v1.2.1 release notes.
bin/devbox Remove interactive renewal loop; add proxy self-renewal detection/restart, proxy refresh, and Homebrew gh link management.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread proxy/devbox-ai-proxy.py
Comment on lines +762 to +766
with open(entry.path, encoding="utf-8") as endpoint_file:
endpoint = endpoint_file.read(4096).strip()
parsed = urlsplit(endpoint)
endpoint_port = parsed.port or 4141
except (OSError, ValueError):
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