Skip to content

docs(#6485): add pi runtime local-run guide section - #6508

Merged
waynesun09 merged 9 commits into
mainfrom
agent/6485-pi-runtime-local-guide
Aug 23, 2026
Merged

docs(#6485): add pi runtime local-run guide section#6508
waynesun09 merged 9 commits into
mainfrom
agent/6485-pi-runtime-local-guide

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new "Run a minimal agent on the pi runtime" section to docs/guides/user/running-agents-locally.md, documenting how to run a minimal pi agent locally without cloning the fleet repo. Also adds a cross-reference from docs/runtimes.md Pi-specific known constraints section.

Changes

  • docs/guides/user/running-agents-locally.md — new section covering:
    • Pi-specific prerequisites (sandbox image with PI_VERSION, GCP credentials)
    • Working --fullsend-dir directory layout with all required files (config.yaml, harness, agent definition, policies, profiles, providers, env)
    • Example config.yaml, harness YAML, agent .md, and env file with explanations
    • Run command and expected output
    • Run artifacts (metrics.json, session transcripts, pi-debug.log)
    • Runtime knobs (FULLSEND_PI_MODEL, FULLSEND_PI_PROVIDER, FULLSEND_PI_BASH_ALLOWLIST)
    • Security hooks and repo-trust guarantees
    • Troubleshooting section for common pi-specific errors
    • Platform notes for Linux (Fedora) and macOS (Apple Silicon)
  • docs/runtimes.md — adds a callout linking to the new guide section from the Pi-specific known constraints heading

Testing

  • lychee link check passes (all internal links resolve, including fragment anchors)
  • lint-docs-links passes (no docs links escape the repo root)
  • No trailing whitespace or missing end-of-file newlines
  • Gitlint passes on the commit message

Refs #6485 — deliberately not Closes.

Linux: verified end to end — a real fullsend run on Fedora reached 2 turns on Vertex, wrote agent-result.json, produced a pi transcript with tool calls, and recorded "runtime": "pi" in metrics.json.

macOS: verified on darwin/arm64 (macOS 26.5.2) through sandbox creation, pi bootstrap and preflight, Vertex extension load from /usr/local/share/pi-extensions, and model-id translation. The inference call was not exercised from that host — Vertex project access there is environment-specific — so the macOS half of #6485 stays open and the issue stays open with it.

One fix the macOS attempt produced: the example env/gcp-vertex.env used bare KEY=value lines. The sandbox sources .env.d/*.env with a plain . and no set -a (internal/cli/run.go), so those become shell variables pi never inherits — present in the sandbox, no effect. The fleet's own env file uses export for exactly this reason. Fixed, along with the *.env glob requirement and the sandbox-vs-runner meaning of GOOGLE_APPLICATION_CREDENTIALS.

Post-script verification

  • Branch is not main/master (agent/6485-pi-runtime-local-guide)
  • Secret scan passed (gitleaks — 9a184a9ee309d767f0c12131b158f15f9d89fa57..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Add a new "Run a minimal agent on the pi runtime" section to the
running-agents-locally guide. The section documents the working
directory layout, config.yaml requirements, harness composition
(host_files, OpenShell profiles/providers for Vertex egress), run
command, expected output, artifacts, runtime knobs, security hooks,
platform-specific notes, and common troubleshooting scenarios.

Key points from real-world verification:
- A bare config.yaml + harness/ is not sufficient; the harness must
  include host_files for GCP credentials and reference OpenShell
  egress profiles for Vertex
- config.yaml must both register the agent and set
  defaults.runtime: pi
- --env-file sets runner env only; sandbox env comes from the
  harness via env.sandbox and host_files
- --debug is an optional-value flag requiring = syntax
- A stale cached :latest image fails at pi preflight, not with a
  clear "image is old" message

Also adds a cross-reference from docs/runtimes.md Pi-specific known
constraints section to the new guide section.

Closes #6485
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Site preview

Preview: https://57928e39-site.fullsend-ai.workers.dev

Commit: 9ea1431dd00c758ca096a2e7c663bef3f000283d

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:51 AM UTC · Completed 1:06 AM UTC

Commit: fed715e · View workflow run →

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review

Findings

Low

Previous run

Review

Findings

Low

  • [naming/section-structure] docs/guides/user/running-agents-locally.md:479 — The new section includes its own ### Platform notes (pi) subsection (within ## Run a minimal agent on the pi runtime) while the file already has a top-level ## Platform notes section that covers macOS and Linux. Placing pi-specific platform notes inside the pi section rather than alongside the existing ### macOS and ### Linux subsections under ## Platform notes is a structural inconsistency — readers checking ## Platform notes for all platform-specific caveats will miss the pi ones.
    Remediation: Consider adding a cross-reference from ## Platform notes to the pi section's platform notes so a reader scanning the top-level section discovers the pi-specific entries.

  • [scope-gap] docs/guides/user/running-agents-locally.md — Issue docs: run a minimal agent on the pi runtime locally (no fleet repo); verify on Linux and macOS #6485 asks for a copy-pasteable example directory to be shipped (e.g. docs/examples/pi-hello/ or an eval/-style fixture). The PR inlines all file contents in the documentation but does not ship an actual directory tree. This is a minor scope gap against the issue's acceptance criteria.
    Remediation: Either note the deliberate choice to inline rather than ship a fixture directory, or add a follow-up item to the issue for shipping docs/examples/pi-hello/.

Previous run (2)

Review

Findings

Medium

  • [Technical documentation accuracy] docs/guides/user/running-agents-locally.md:330 — The text states "Registering only the harness file causes resolveAgentSource to fail" but this is factually incorrect. resolveAgentSource resolves the harness path independently of runtime selection — it succeeds with just the agents: block. Without defaults.runtime: pi, the runner defaults to the claude runtime (via backendFromConfigFileResolveFromConfig in registry.go), which cannot execute a pi-specific harness. The failure occurs at runtime, not at the resolution step the doc cites.
    Remediation: Replace the sentence with something like: "Without defaults.runtime: pi, the runner defaults to the claude runtime, which cannot execute a pi-specific harness — the agent will fail at runtime, not at resolution."

Low

  • [naming/heading-id-convention] docs/guides/user/running-agents-locally.md:479 — Custom heading ID syntax {#troubleshooting-pi} is not used anywhere else in the docs/ directory. All other headings rely on auto-generated slug anchors (e.g., #troubleshooting, #pi-specific-known-constraints-6464). This introduces a convention absent from the rest of the codebase.
    Remediation: Consider renaming the heading to produce a unique auto-slug instead, e.g., ### Troubleshooting pi runtime (slug: #troubleshooting-pi-runtime), and updating the two internal links that reference #troubleshooting-pi to use the new auto-slug.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 23, 2026
The section promised minimal contents for `policies/`, `profiles/` and
`providers/` and then never gave them, so a reader following it without an
agents clone stops at the first missing file. All three are short; they are
now included, with the reason each matters — the policy's read_only prefixes
(why the pi extension moved out of /opt, #6504), the egress allowlist
(without it pi reports model-not-found rather than a network error), and the
provider binding.

Also: drop `--keep-sandbox` from the first command a reader runs and explain
it separately, since kept sandboxes are not cleaned up; and give the example
agent the `name:`/`description:` frontmatter the fleet agents carry.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed against the run this documents — I am the one who worked the recipe out, so I checked the guide's claims rather than its prose.

Verified correct: both tools: forms parse (piToolSpecs accepts a comma string or a YAML list), model: in agent frontmatter is real (the fleet's triage.md uses it), analyze-transcript.py summary <file> is a valid invocation, the env/gcp-vertex.env contents line up with the host_files destination (GOOGLE_APPLICATION_CREDENTIALS=/tmp/.gcp-credentials.json matches where the key is copied), and all three troubleshooting entries are real failures I hit in that order.

Four things I pushed on top (26f7b0ae, fast-forward):

  1. The section promised minimal contents for policies/, profiles/ and providers/ and then never gave them — a reader without an agents clone stops at the first missing file. All three are short, so they are now inline, each with the reason it matters: the policy's read_only prefixes (which is why the pi extension had to move out of /opt, #6504), the egress allowlist (without it pi reports model-not-found rather than a network error — a misleading symptom worth naming), and the provider binding.
  2. --keep-sandbox was in the first command a reader runs. Kept sandboxes are not cleaned up, so that teaches a leak; moved to a note after the success output.
  3. The example agent frontmatter had no name:/description:, unlike every fleet agent. Optional in the parser, but the example is what people copy.
  4. Closes #6485Refs #6485. The issue also asks for macOS verification, which has not happened. The Linux half is verified end to end; closing the issue on a Linux-only result would bury the remaining half.

Approving with those applied.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed against the run this documents. Verified: both tools: forms parse (piToolSpecs takes a comma string or a YAML list), model: in agent frontmatter is real, analyze-transcript.py summary <file> is valid, the env/gcp-vertex.env values line up with the host_files destination, and all three troubleshooting entries are failures I hit in that order.

Four fixes pushed on top (26f7b0ae, fast-forward):

  1. The section promised minimal contents for policies/, profiles/ and providers/ and never gave them — a reader without an agents clone stops at the first missing file. All three are short, so they are inline now, each with why it matters: the policy's read_only prefixes (why the pi extension moved out of /opt, #6504), the egress allowlist (without it pi reports model-not-found rather than a network error), and the provider binding.
  2. --keep-sandbox was in the first command a reader runs; kept sandboxes are not cleaned up, so that teaches a leak. Moved to a note after the success output.
  3. The example agent frontmatter lacked name:/description: unlike every fleet agent — optional in the parser, but examples are what people copy.
  4. Closes #6485Refs #6485: the issue also asks for macOS verification, which has not happened. Closing on a Linux-only result would bury the remaining half.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 1:43 AM UTC · Ended 1:46 AM UTC

Commit: 26f7b0a · View workflow run →

…g id

The review is right that "registering only the harness file causes
resolveAgentSource to fail" reads as though a missing `defaults.runtime`
is what fails, which it is not. The two requirements fail in different
places, and the difference matters to anyone debugging:

- no `agents:` entry — `resolveAgentSource` fails outright with
  `no config and agents-repo fallback unavailable` (observed)
- no `defaults.runtime: pi` — the run *succeeds* on the default claude
  runtime and pi is never started; the tell is `runtime: selected "claude"`

The second is the more dangerous one to leave undocumented, since nothing
errors.

Also drops `{#troubleshooting-pi}`: no other file under docs/ uses a custom
heading id, so the heading is renamed to produce the auto-slug instead.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:47 AM UTC · Completed 2:04 AM UTC

Commit: 8800b3b · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed requires-manual-review Review requires human judgment labels Aug 23, 2026
The pi walkthrough keeps its platform notes inline so the section reads
start to finish, but a reader who goes to '## Platform notes' for
platform-specific detail would not find them. Adds a pointer there rather
than splitting the pi section.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-approving after the review round: 8800b3bd corrects the two config failure modes and drops the custom heading id, 226a48b0 adds the pointer from ## Platform notes. All three review threads resolved.

Validating the guide's own recipe on macOS now (arm64, macOS 26.5.2) — following it as written, from a clean directory, which is the real test of whether the supporting-file contents are complete. Will report before this merges.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 2:20 AM UTC · Ended 2:23 AM UTC

Commit: 226a48b · View workflow run →

Validated on darwin/arm64 (macOS 26.5.2): sandbox creation, pi bootstrap and
preflight, Vertex extension load and model-id translation all work. The run
stopped at the inference call because the GCP project is VPN-restricted from
that host.

Documents the symptom, because it is misleading: 'Could not load the default
credentials' names credentials, but the same text appears when the token
endpoint is unreachable. Turns: 1 with zero tokens distinguishes 'pi started
and the call never completed' from a genuine credential problem.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
Vertex project access from that host is environment-specific and not
something the guide should carry. The macOS note keeps only what is
verified there: sandbox creation, pi bootstrap and preflight, Vertex
extension load, and model-id translation.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Ended 2:25 AM UTC

Commit: 5975185 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 2:27 AM UTC · Ended 2:29 AM UTC

Commit: 6dfdea3 · View workflow run →

Re-validated by rebuilding the example from this section's own code blocks
and running it: all seven files extract cleanly and the run reaches 3 turns,
so the layout and file contents are complete and correct.

Two things the section got wrong for a reader following it literally:

- The artifact tree promised security/findings.jsonl, which a clean run does
  not create — the directory is empty unless a hook reports something. It
  also omitted the per-run sandbox-named subdirectory, so the paths shown
  did not exist as written, and left out output.jsonl and run-telemetry.jsonl.
- The analyze-transcript path was missing that same subdirectory, and the
  command showed no output, so a reader could not tell whether it worked.
  Adds the real output and names the other two useful subcommands.

The sample run output is refreshed from the validation run.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 2:31 AM UTC · Ended 2:33 AM UTC

Commit: 00bd01b · View workflow run →

The harness declares role: triage but the example wrote
{"target_branch": "main"}, which is not a triage result — the schema
requires action/reasoning/comment and forbids extra keys. Harmless under
--no-post-script, which this example passes, but it teaches a shape that
fails the moment anyone drops the flag or reuses the harness.

The agent now writes a schema-valid triage result, with a line explaining
why it looks like that. Re-validated end to end: the example rebuilt from
these code blocks runs to 2 turns and the file it produces has exactly the
three required keys and no extras.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:35 AM UTC · Completed 2:47 AM UTC

Commit: 9ea1431 · View workflow run →

@waynesun09
waynesun09 added this pull request to the merge queue Aug 23, 2026
Merged via the queue into main with commit 1f027be Aug 23, 2026
32 checks passed
@waynesun09
waynesun09 deleted the agent/6485-pi-runtime-local-guide branch August 23, 2026 02:49
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 23, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 2:51 AM UTC · Completed 3:02 AM UTC

Commit: 9ea1431 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6508 — pi runtime local-run guide

Workflow: Issue #6485 → triage (3 runs) → code agent (run 32608488659) → PR #6508 → review agent (3 completed runs, 4 cancelled) → 8 human follow-up commits → merged by @waynesun09.

Agents repo: fullsend-ai/agents@main (code agent at 94e345c, review agent at c71d143).

What went well

  • Code agent produced a solid 356-line first draft in ~4 minutes, correctly structuring the guide with prerequisites, directory layout, config examples, run commands, artifacts, troubleshooting, and platform notes. It also caught and fixed a broken ADR link (0055-env-sandbox-key.md0055-unified-env-var-delivery.md) during self-verification with lychee.
  • Review agent independently caught the most impactful technical inaccuracy — the resolveAgentSource claim conflating two different failure modes — which the human confirmed and fixed. It also flagged a style inconsistency (custom heading ID) that the human agreed with.
  • The code agent correctly used "Refs docs: run a minimal agent on the pi runtime locally (no fleet repo); verify on Linux and macOS #6485" instead of "Closes" since macOS verification was incomplete — good judgment.

What could go better

  • Rework rate was high: 8 human follow-up commits after the agent's initial PR. ~5 of these fixed issues traceable to the code agent not verifying its claims against source code: incorrect failure mode documentation, missing export in env files (verifiable via internal/cli/run.go), missing real file contents for policies/profiles/providers, artifact tree not matching real output, and output schema not matching declared role.
  • Review agent gaps: The review agent caught the resolveAgentSource error but missed the export requirement in env files (checkable by reading the env sourcing code), the guide claiming "fleet-free" while referencing external files, and the output/role schema mismatch. These are self-consistency and source-verification checks that don't require runtime access.

Existing issue evidence

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant