Skip to content

feat(fetchsvc): in-sandbox fetch-skill subcommand (Phase 4, PR 2) - #2221

Closed
ggallen wants to merge 1 commit into
mainfrom
feat/adr-0038-phase4-pr2
Closed

feat(fetchsvc): in-sandbox fetch-skill subcommand (Phase 4, PR 2)#2221
ggallen wants to merge 1 commit into
mainfrom
feat/adr-0038-phase4-pr2

Conversation

@ggallen

@ggallen ggallen commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds fullsend fetch-skill <url> subcommand for agents to fetch skills at runtime from inside the sandbox, communicating with the runner-side fetch service over HTTP with bearer token auth
  • Adds fetch server lifecycle management (startFetchService) with dynamic TCP port allocation, per-run UUID bearer token (timing-safe comparison), and graceful shutdown
  • Adds SandboxUploader adapter wrapping sandbox.UploadDir to implement the fetchsvc.Uploader interface
  • Wires the fetch service into runAgent() and injects FULLSEND_FETCH_URL / FULLSEND_FETCH_TOKEN env vars during sandbox bootstrap
  • Includes carryover fixes from feat(fetchsvc): runner-side runtime fetch service (Phase 4, PR 1) #2173 review: CachePutDir return value correctness, audit log error propagation, MaxBytesError → 413

Context

This is Phase 4, PR 2 of ADR-0038 (Universal Harness Access). PR 1 (#2173) delivered the runner-side fetchsvc package. This PR completes the client side so agents can invoke fullsend fetch-skill inside the sandbox. PR 3 will add allow_runtime_fetch / max_runtime_fetches harness schema fields to gate the feature.

Key decisions

  • Subcommand, not separate binary — reuses the fullsend binary already uploaded to /sandbox/workspace/bin/fullsend, avoiding cross-compilation and GoReleaser changes
  • HTTP over TCP, not Unix socket — OpenShell sandboxes are containers with no shared filesystem; TCP through the L7 proxy is the established transport (ADR-0046)
  • Bearer token auth — per ADR-0046, a per-run random token delivered via env var; timing-safe comparison prevents timing attacks

Test plan

  • 10 unit tests for fetch-skill subcommand (success, error codes, missing env, auth propagation, request body, timeout)
  • 7 unit tests for fetch server (lifecycle, fetch endpoint, auth rejection, token validation, token generation)
  • go test ./... — all 28 packages pass
  • go vet clean
  • make lint passes
  • fullsend fetch-skill --help displays correct usage

🤖 Generated with Claude Code

Add `fullsend fetch-skill` subcommand for agents to fetch skills at
runtime from inside the sandbox. The subcommand reads FULLSEND_FETCH_URL
and FULLSEND_FETCH_TOKEN from the environment and POSTs the skill URL to
the runner-side fetch service over HTTP.

The runner starts the fetch service on a dynamic TCP port with per-run
bearer token authentication (timing-safe comparison). The service is
wired into the run flow and environment variables are injected during
sandbox bootstrap. A SandboxUploader adapter wraps sandbox.UploadDir to
implement the fetchsvc.Uploader interface.

Also includes carryover fixes from PR 1 review: use treeHash from
CachePutDir for CachePath, propagate audit log errors, and detect
MaxBytesError to return 413.

Signed-off-by: Greg Allen <gallen@redhat.com>
Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Greg Allen <gallen@redhat.com>
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://bf7a4e9e-site.fullsend-ai.workers.dev

Commit: 6f269dbfd59255ec730129069c1d71a2ae70d1dc

@ggallen ggallen closed this Jun 12, 2026
@ggallen
ggallen deleted the feat/adr-0038-phase4-pr2 branch June 12, 2026 12:54
@fullsend-ai-review

fullsend-ai-review Bot commented Jun 12, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:54 PM UTC · Completed 1:07 PM UTC
Commit: 6f269db · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review skipped — this PR is already closed.

The /fs-review command only reviews open pull requests.

Posted by fullsend pre-review check

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 12, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 12:58 PM UTC · Completed 1:04 PM UTC
Commit: 6f269db · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2221 — closed-and-replaced PR triggered wasted agent runs

What happened: PR #2221 (feat(fetchsvc): in-sandbox fetch-skill subcommand) was opened by ggallen at 12:51 UTC and closed 3 minutes later at 12:54 UTC without merge. The author deleted the branch and immediately re-created the PR as #2223 at 12:54 UTC. During those 3 minutes, the review agent was dispatched (run 27416794686) but the PR was closed before review completed, so the review bot posted "Review skipped — this PR is already closed." A retro dispatch was also triggered on the closed PR.

Wasted work: The review run consumed tokens and compute before discovering the PR was closed. The retro run (this one) was also dispatched unnecessarily on a PR with no agent interaction and no merge.

No new proposals — all improvements already tracked:

Improvement Existing issues
Skip review/fix dispatch when PR is closed #1870, #1439
Check PR state before posting review results #885
Skip retro for closed-without-merge PRs with immediate successor #2176, #1411
Cancel in-progress review dispatches on same PR #1357

This PR is a textbook case for all of these issues. Prioritizing #1870 and #2176 would prevent the most common source of wasted agent runs in close-and-recreate workflows.

@fullsend-ai-review

Copy link
Copy Markdown

Review skipped — this PR is already closed.

The /fs-review command only reviews open pull requests.

Posted by fullsend post-review check

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.

1 participant