@polygraph/opencode-plugin 0.4.43 → 0.4.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,12 +20,12 @@ The main agent provides these parameters in the prompt:
20
20
  | `sessionId` | The Polygraph session ID |
21
21
  | `repo` | Repository to delegate to (e.g., `org/repo-name`) |
22
22
  | `instruction` | The task instruction for the child agent |
23
- | `role` | (Optional) Agent slot within the repo; omit for the default role. Pass the SAME role on every `spawn_agent`/`show_agent`/`stop_agent` call for this delegation. |
23
+ | `role` | (Optional) Agent slot within the repo; omit for the default role and never invent one. Pass the SAME role on every `spawn_agent`/`show_agent`/`stop_agent` call for this delegation. |
24
24
  | `context` | (Optional) Additional context to pass to the child agent |
25
25
 
26
26
  ## Delegating work
27
27
 
28
- Call the `spawn_agent` tool to start a child agent on the repo or to send a follow-up to an active task. Follow-up routing is automatic per (repo, role): if that (repo, role) already has an active child task (working or paused on input), the orchestrator delivers your `instruction` to that task as a follow-up message rather than starting a second run; otherwise it starts a new child run. A repo therefore has at most one active child per role, though agents with different roles can run in the same repo concurrently.
28
+ Call the `spawn_agent` tool to start a child agent on the repo or to send a follow-up to an active task. Follow-up routing is automatic per (repo, role): if that (repo, role) already has an active child task (working or paused on input), the orchestrator delivers your `instruction` to that task as a follow-up message rather than starting a second run; otherwise it starts a new child run. A repo therefore has at most one active child per role.
29
29
 
30
30
  `repo` must be a repository other than the one the parent agent is working in — never delegate into the parent's own repo.
31
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polygraph/opencode-plugin",
3
- "version": "0.4.43",
3
+ "version": "0.4.44",
4
4
  "description": "AI agent skills and subagents for Polygraph sessions, repository context, and coordination",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -20,29 +20,29 @@ Polygraph functionality is available via both MCP tools and CLI commands. Use wh
20
20
  | --- | --- | --- |
21
21
  | `list_repos` | `polygraph repo list` | Discover candidate repositories. Candidate entries do not include repository descriptions; use `semanticQuery` for natural-language discovery. |
22
22
  | `start_session` | `polygraph session start --repo <ids>` | Initialize a Polygraph session with selected repositories |
23
- | `spawn_agent` | — | Start a new child task or send a follow-up to an active task in another repository. Input: `{ sessionId, repo, instruction, role?, context? }`. Output: `{ taskId, message, status: 'delegated' }`. `role` selects the agent slot within the repo (see "Agent roles"). Follow-up routing is automatic per (repo, role): if that (repo, role) already has an active child task, the instruction is delivered to it as a follow-up message; otherwise a new child run starts. A session resume or reconstruction is read-only context restoration; after resuming, do not use `spawn_agent` to continue changes unless the user explicitly asks for changes. |
24
- | `show_agent` | — | Poll one repo's child status (`repo` required — one repo per call; pass `role` to narrow to that role's agent). Returns `{ children: [...] }` with one self-describing entry per matching agent, exposing `status`, `lastOutputLines`, `role` (absent for the default role), `inputRequiredQuestion`, etc. Full status enum and the poll/state-machine flow are under "Multi-turn tasks". |
25
- | `stop_agent` | — | Cancel an in-progress child. Input: `{ sessionId, repo, role? }`. Output: `{ taskId, state: 'cancelled', sessionPreserved: true, output, message }`. Because `sessionPreserved: true`, the preserved agent session can be restored later for context, but resume must wait for explicit user instructions before making changes. |
23
+ | `spawn_agent` | — | Start a child task, or send a follow-up to an active task, in another repository. A repeat call for the same (repo, role) is delivered to that task as a follow-up; otherwise a new child starts. Roles and resume behavior are under "Multi-turn tasks". |
24
+ | `show_agent` | — | Poll one repo's child status (one repo per call; `role` narrows to that agent). Status enum and the poll/state-machine flow are under "Multi-turn tasks". |
25
+ | `stop_agent` | — | Cancel an in-progress child; its session is preserved for later read-only context restoration. |
26
26
  | `push_branch` | — | Push a local git branch to the remote repository. For the repo you are in, this pushes from your current checkout. Requires a session description. |
27
27
  | `create_pr` | — | Create draft PRs with session metadata linking related PRs |
28
28
  | `show_session` | `polygraph session show <id> [--details]` | Query status of the current session. Use details when session summary, repo IDs, PR URLs, and PR descriptions are needed. |
29
- | `update_session` | `polygraph session update --session <id> [--title] [--description]` | Update the session title and/or description (at least one required). Set the description from a synthesized progress summary or user-provided text. This updates session metadata only; it does not require PR creation or mark-ready. |
29
+ | `update_session` | `polygraph session update --session <id> [--title] [--description]` | Update the session title and/or description (at least one required); metadata only, independent of PR creation or mark-ready. |
30
30
  | `link_reference` | — | Link an external reference to a session. |
31
31
  | `mark_pr_ready` | — | Mark draft PRs as ready for review |
32
32
  | `associate_pr` | — | Associate an existing PR with a session |
33
- | `add_repo` | — | Add repositories to a running Polygraph session. For explicit refs, pass the refs directly and skip `list_repos`. |
33
+ | `add_repo` | — | Add repositories to a running session (pass exact refs directly, skipping `list_repos`). See "Add Repositories to a Session". |
34
34
  | `archive_session` | `polygraph session archive <id>` | Archive a session, hiding it from active lists (it can still be resumed) |
35
35
  | `get_ci_logs` | — | Retrieve full plain-text log for a specific CI job |
36
- | `git_fetch` | `polygraph git fetch` | Fetch additional git history for a shallow session clone. Use when git operations fail with "bad object" or missing-commit errors; by default fetches the full history of the default branch. Input: `{ sessionId, repo, depth?, refs? }`. See "Fetching Git History for Shallow Clones". |
36
+ | `git_fetch` | `polygraph git fetch` | Fetch git history for a shallow session clone when git fails with "bad object" or missing-commit errors. See "Fetching Git History for Shallow Clones". |
37
37
  | `login` | `polygraph auth login [--token]` | Authenticate with Polygraph (use `--token` for headless/CI) |
38
38
  | `logout` | `polygraph auth logout` | Log out of Polygraph |
39
39
  | `list_sessions` | `polygraph session list` | List sessions. By default only active sessions created by the current git user; pass `recommendedFilters: false` for all sessions. |
40
- | `search_sessions` | `polygraph session search` | Find sessions by free-text `query` OR by commit `sha` — pass EXACTLY ONE of the two (they are mutually exclusive). `sha` (CLI: `--sha <sha>`) is an exact lookup of the session(s) linked to a commit, full or partial, 7-40 hex chars; it returns matching sessions newest first, org-scoped, and explicit sessions only (implicit sessions are never returned). Supports `--json` and `--limit` (1-50). See "Finding the Session Behind a Commit or Line". |
40
+ | `search_sessions` | `polygraph session search` | Find sessions by free-text `query` OR by commit `sha` — pass exactly one. See "Finding the Session Behind a Commit or Line". |
41
41
  | `list_accounts` | `polygraph account list` | List available organizations |
42
42
  | `select_account` | `polygraph account select` | Select the organization that future commands run against |
43
43
  | `whoami` | `polygraph whoami` | Show current auth status and org |
44
44
 
45
- **Delegation rules:** `list_repos` and `start_session` MUST be called via the `polygraph-init-subagent` as described in step 0. Direct `add_repo` is allowed only when the user provides exact repo refs for an existing session. `spawn_agent` and `show_agent` MUST ALWAYS be called via `@polygraph-delegate-subagent` as described in the delegation sections below — NEVER call them directly in the main conversation.
45
+ **Delegation rules:** `list_repos` and `start_session` MUST be called via the `polygraph-init-subagent` as described in the "Initialize or Join Polygraph Session" section. Direct `add_repo` is allowed only when the user provides exact repo refs for an existing session. `spawn_agent` and `show_agent` MUST ALWAYS be called via `@polygraph-delegate-subagent` as described in the delegation sections below — NEVER call them directly in the main conversation.
46
46
 
47
47
  ## CLI Statefulness
48
48
 
@@ -71,7 +71,7 @@ After logging in (or if logged in but no org is selected), use `polygraph accoun
71
71
  The delegate/monitor/stop steps apply only when working across repos. A single-repo session skips them and still benefits from shared progress, resume, and CI visibility.
72
72
 
73
73
  0. **Initialize or join Polygraph session** - If you were spawned inside an existing session (the startup banner names a session ID), reuse it. Call `show_session` first; if it already has repos and the user did not ask to add more, you're done. If the user asks to add exact repo refs, call `add_repo` directly with those refs and skip candidate discovery. If the session has no repos and no exact refs were provided, launch the `polygraph-init-subagent` with that `sessionId` so it discovers candidates and uses `add_repo` (NOT `start_session`). Only when there is no session ID at all should the init subagent create a new session.
74
- 1. **Delegate work to each repo** - Use the `polygraph-delegate-subagent` to start child agents in other repositories. Delegate only to *other* repos — never to the repo you are in; work on it directly (your regular subagents are fine for local work — only Polygraph delegation is reserved for other repos). Parallel delegation across repos is encouraged; a repo can also host multiple concurrent agents under distinct roles (see "Agent roles"). Choose the Simple (fire-and-forget) or Multi-turn (interactive) pattern described below based on whether the child may need clarification.
74
+ 1. **Delegate work to each repo** - Use the `polygraph-delegate-subagent` to start child agents in other repositories. Delegate only to *other* repos — never to the repo you are in; work on it directly (your regular subagents are fine for local work — only Polygraph delegation is reserved for other repos). Parallel delegation across repos is encouraged. Choose the Simple (fire-and-forget) or Multi-turn (interactive) pattern described below based on whether the child may need clarification.
75
75
 
76
76
  4. **Monitor child agents** - Use `show_agent` to poll one repo's children (`repo` is required; pass `role` to narrow to one agent) and read each entry's `status` and `lastOutputLines` from the `children[]` array.
77
77
  5. **Stop child agents** (if needed) - Use `stop_agent` (with `role` when targeting a non-default agent) to cancel an in-progress child agent. The agent's session is preserved for later read-only context restoration; after a resume, wait for explicit user instructions before making changes.
@@ -85,7 +85,7 @@ The delegate/monitor/stop steps apply only when working across repos. A single-r
85
85
 
86
86
  ## Step-by-Step Guide
87
87
 
88
- ### 0. Initialize or Join Polygraph Session
88
+ ### Initialize or Join Polygraph Session
89
89
 
90
90
  There are three cases. Pick exactly one before calling any tool. The case labels are internal routing shorthand — never mention them in anything you show the user.
91
91
 
@@ -206,6 +206,7 @@ polygraph session search --sha a1b2c3d
206
206
 
207
207
  A repository in a session can host multiple child agents at once, distinguished by **role**:
208
208
 
209
+ - **Omit by default.** Set a `role` only when the user very explicitly asked for a named one, or when a skill the user invoked prescribes one (e.g. `adversarial-review` uses `reviewer`). Never pick one yourself.
209
210
  - **Purpose.** Roles let independent streams of work run concurrently in one repo — e.g. a default agent implementing a feature while a `reviewer` or `ci-investigator` runs alongside. Each (repo, role) pair has at most one active child.
210
211
  - **Default role.** An omitted `role` means the default role: `spawn_agent` without `role` starts or follows up with the repo's default-role agent.
211
212
  - **Logs.** Only default-role agents upload logs to the cloud and appear in the multiplexed log stream (`polygraph session logs`). Inspect non-default agents locally with `polygraph agent attach --role <role>`.
@@ -320,7 +321,9 @@ When polling `cloud_polygraph_child_status` (or `show_agent`), treat `permission
320
321
  4. Call `allow_agent` (to grant) or `deny_agent` (to refuse) with `{ sessionId, repo, role? }`.
321
322
  5. Resume polling.
322
323
 
323
- ### 2. Publish Changes (Push Branches, Create PRs, Mark Ready)
324
+ ## Publishing and Session Management
325
+
326
+ ### Publish Changes (Push Branches, Create PRs, Mark Ready)
324
327
 
325
328
  Publishing covers the branch-to-PR flow: `push_branch` (push local commits; must precede PR creation), `create_pr` (linked draft PRs, including fork PRs via `targetRepository`), `mark_pr_ready` (transition drafts to OPEN), and `associate_pr` (link PRs created outside Polygraph).
326
329
 
@@ -332,7 +335,7 @@ Publishing covers the branch-to-PR flow: `push_branch` (push local commits; must
332
335
 
333
336
  **Whenever you write or update a session description, read [`reference/session-description.md`](reference/session-description.md) first.** That reference file holds the full policy: the canonical Markdown-heading template (`## Goal` / `## Current progress` / `## What worked` / `## Next steps`), the dual-audience guidance (humans in the web UI now, agents reconstructing history later), and the formatting building blocks the app renders (callouts, tables, mermaid, links, `link_reference`).
334
337
 
335
- ### 3. Get Current Polygraph Session
338
+ ### Get Current Polygraph Session
336
339
 
337
340
  Check the details of a session using `show_session` or `polygraph session show --details <session-id>`. Returns the full session state — basic metadata like id, url & description timeline, plus the connected repositories, `pullRequests[]`, per-PR `ciStatus`, and `session.linkedReferences`.
338
341
 
@@ -390,7 +393,7 @@ link_reference({
390
393
 
391
394
  The canonical MCP parameters are `{ sessionId, reference }`. There is no unlink command.
392
395
 
393
- ### 4. Add Repositories to a Session
396
+ ### Add Repositories to a Session
394
397
 
395
398
  Use `add_repo` to add repositories to an existing Polygraph session after it has already started.
396
399
 
@@ -410,27 +413,11 @@ add_repo(
410
413
  )
411
414
  ```
412
415
 
413
- ### 5. Archive Session
416
+ ### Archive Session
414
417
 
415
418
  **IMPORTANT: Only call this tool when the user explicitly asks to archive or close the session.** Do not archive sessions automatically as part of the workflow.
416
419
 
417
- Use `archive_session` (CLI: `polygraph session archive <id>`) to archive the session. Archiving only hides the session from active lists — it can still be resumed and interacted with afterwards. It is idempotent — archiving an already-archived session returns success.
418
-
419
- **Parameters:**
420
-
421
- - `sessionId` (required): The Polygraph session ID
422
- - `clean` (optional): Remove the local clones Polygraph created for delegated repos after archiving
423
-
424
- **Returns:**
425
-
426
- - `sessionId`: The session ID
427
- - `completed`: Boolean indicating the session is archived
428
-
429
- ```
430
- archive_session(
431
- sessionId: "<session-id>"
432
- )
433
- ```
420
+ Use `archive_session` (CLI: `polygraph session archive <id>`) to archive the session. Archiving only hides the session from active lists — it can still be resumed and interacted with afterwards. It is idempotent — archiving an already-archived session returns success. Pass the optional `clean` flag to also remove the local clones Polygraph created for delegated repos.
434
421
 
435
422
  **When to call:** all work is finished, PRs are created and marked ready, and the user explicitly confirms they are done with the session.
436
423
 
@@ -438,46 +425,13 @@ archive_session(
438
425
 
439
426
  ### Retrieving CI Job Logs
440
427
 
441
- Use `get_ci_logs` to retrieve the full plain-text log for a specific CI job. This is the drill-in tool for investigating CI failures after identifying a failed job from the session's CI status.
442
-
443
- **ONLY use this tool when NO CIPE (CI Pipeline Execution) exists for the PR.** When a CIPE exists (`ciStatus[prId].cipeUrl` is non-null), logs and failure data are available through the CIPE system (Nx Cloud) via the Nx MCP `ci_information` tool — do NOT call `get_ci_logs`, and do NOT fetch or poll the `cipeUrl` over HTTP (it is a browser link for the user, not an API). This tool is specifically for PRs where only external CI runs exist (e.g., GitHub Actions runs without an Nx Cloud CIPE).
444
-
445
- **Parameters:**
446
-
447
- - `sessionId` (required): The Polygraph session ID
448
- - `repoId` (required): Repository ID (MongoDB ObjectId hex string, from the session repository entry)
449
- - `jobId` (required): GitHub Actions job ID (from `ciStatus[prId].externalCIRuns[].jobs[].jobId` in the `show_session` response)
450
-
451
- **Returns:**
452
-
453
- - On success: `{ success: true, jobId: number, logFile: string, sizeBytes: number }`
454
- - On failure: `{ success: false, error: string }`
455
-
456
- The tool saves the log to a local temp file and returns the path in `logFile`. Use the `Read` tool to examine the file contents. For large logs, use `offset` and `limit` parameters to read specific sections.
457
-
458
- ```
459
- get_ci_logs(
460
- sessionId: "<session-id>",
461
- repoId: "<repo-id>",
462
- jobId: 12345678
463
- )
464
- // Returns: { success: true, jobId: 12345678, logFile: "/tmp/ci-logs/job-12345678.log", sizeBytes: 152340 }
465
- // Then: Read(logFile) to examine the log
466
- ```
467
-
468
- **Typical flow:**
469
-
470
- 1. Use `show_session` to see PR CI status
471
- 2. Check `ciStatus[prId].cipeUrl` — if a CIPE exists, use `ci_information` for logs and skip this tool
472
- 3. If NO CIPE exists, check `ciStatus[prId].externalCIRuns` — examine runs and jobs directly from the session data
473
- 4. For a failed job, call `get_ci_logs(sessionId, repoId, jobId)` to save the log to a file
474
- 5. Use `Read(logFile)` to examine the log content — use `offset`/`limit` for large files
428
+ `get_ci_logs` retrieves the full plain-text log for a specific CI job the drill-in tool for investigating a failed job. **ONLY use it when NO CIPE (CI Pipeline Execution) exists for the PR** (`ciStatus[prId].cipeUrl` is null); when a CIPE exists, use the Nx MCP `ci_information` tool instead, and do NOT fetch or poll the `cipeUrl` over HTTP.
475
429
 
476
- **Important:** Logs can be large (100KB+). Only fetch logs for failed or relevant jobs, and read only the sections you need.
430
+ When you need to fetch and read a failed job's log, read [`reference/ci-job-logs.md`](reference/ci-job-logs.md) for the parameters, return shape, and the full flow (identify the job from `externalCIRuns`, call `get_ci_logs`, then `Read` the saved log file).
477
431
 
478
432
  ### Fetching Git History for Shallow Clones
479
433
 
480
- Session repos are shallow (`--depth 1`) clones and plain `git fetch --unshallow` fails on private repos (the clone-time credential is not retained). When git fails on missing history (`bad object` from `git revert`, `git log`, `git blame`, etc.), call `git_fetch({ sessionId, repo })` (CLI: `polygraph git fetch <repo> --session <id> --json`), then retry. Defaults fetch the default branch's full history; pass `depth` for a bounded fetch or `refs` for extra branches. Safe to call redundantly (`alreadyComplete: true`).
434
+ Session repos are shallow (`--depth 1`) clones. When git fails on missing history (`bad object` from `git revert`, `git log`, `git blame`, etc.), call `git_fetch({ sessionId, repo })` and retry. Read [`reference/shallow-clone-history.md`](reference/shallow-clone-history.md) for the CLI form, the `depth`/`refs` options, and the redundant-call behavior.
481
435
 
482
436
  ### Update Session Description
483
437
 
@@ -0,0 +1,38 @@
1
+ # Retrieving CI Job Logs
2
+
3
+ Use `get_ci_logs` to retrieve the full plain-text log for a specific CI job. This is the drill-in tool for investigating CI failures after identifying a failed job from the session's CI status.
4
+
5
+ **ONLY use this tool when NO CIPE (CI Pipeline Execution) exists for the PR.** When a CIPE exists (`ciStatus[prId].cipeUrl` is non-null), logs and failure data are available through the CIPE system (Nx Cloud) via the Nx MCP `ci_information` tool — do NOT call `get_ci_logs`, and do NOT fetch or poll the `cipeUrl` over HTTP (it is a browser link for the user, not an API). This tool is specifically for PRs where only external CI runs exist (e.g., GitHub Actions runs without an Nx Cloud CIPE).
6
+
7
+ **Parameters:**
8
+
9
+ - `sessionId` (required): The Polygraph session ID
10
+ - `repoId` (required): Repository ID (MongoDB ObjectId hex string, from the session repository entry)
11
+ - `jobId` (required): GitHub Actions job ID (from `ciStatus[prId].externalCIRuns[].jobs[].jobId` in the `show_session` response)
12
+
13
+ **Returns:**
14
+
15
+ - On success: `{ success: true, jobId: number, logFile: string, sizeBytes: number }`
16
+ - On failure: `{ success: false, error: string }`
17
+
18
+ The tool saves the log to a local temp file and returns the path in `logFile`. Use the `Read` tool to examine the file contents. For large logs, use `offset` and `limit` parameters to read specific sections.
19
+
20
+ ```
21
+ get_ci_logs(
22
+ sessionId: "<session-id>",
23
+ repoId: "<repo-id>",
24
+ jobId: 12345678
25
+ )
26
+ // Returns: { success: true, jobId: 12345678, logFile: "/tmp/ci-logs/job-12345678.log", sizeBytes: 152340 }
27
+ // Then: Read(logFile) to examine the log
28
+ ```
29
+
30
+ **Typical flow:**
31
+
32
+ 1. Use `show_session` to see PR CI status
33
+ 2. Check `ciStatus[prId].cipeUrl` — if a CIPE exists, use `ci_information` for logs and skip this tool
34
+ 3. If NO CIPE exists, check `ciStatus[prId].externalCIRuns` — examine runs and jobs directly from the session data
35
+ 4. For a failed job, call `get_ci_logs(sessionId, repoId, jobId)` to save the log to a file
36
+ 5. Use `Read(logFile)` to examine the log content — use `offset`/`limit` for large files
37
+
38
+ **Important:** Logs can be large (100KB+). Only fetch logs for failed or relevant jobs, and read only the sections you need.
@@ -0,0 +1,33 @@
1
+ # Sandboxing in Polygraph Sessions
2
+
3
+ Polygraph may run an agent session inside an OS-level sandbox, but not every session is sandboxed — whether it is on depends on the user's config (globally, per-agent, or per-repo). When it is on, writes are limited to the repository working tree, the session root (`~/.polygraph/sessions/<session-id>/`), the system temp directory, and a few allowlisted directories; network access is restricted to allowlisted hosts. In practice: binding a listening socket is denied (dev servers fail with `EPERM`), localhost servers are unreachable, and writes outside the allowlist are rejected. The user may not know whether this session is sandboxed.
4
+
5
+ **Recognize sandbox denials — do not retry or work around them.** When a command fails in a sandbox-shaped way (`EPERM` binding a port, a blocked network host, a denied write to an ordinary path), the sandbox blocked it. Do NOT retry variations, escalate through workarounds, or route the command through `!`-prefixed user commands — those run inside the same sandbox. One failure is enough evidence; stop and inform the user.
6
+
7
+ **Warn before attempting known-blocked operations.** Before starting a dev server, anything else that listens on a port, or an operation that needs writes or network access outside the allowlist, tell the user up front that it will not work while sandboxing is on and offer the options below instead of attempting it.
8
+
9
+ **What to tell the user.** Explain that Polygraph runs this session in a sandbox, then present both options. Each takes effect on the next agent launch, so the Polygraph session must be relaunched afterwards:
10
+
11
+ 1. **Keep the sandbox on and allow the specific operation** (preferred). The sandbox belongs to the agent harness, so exceptions live in harness settings committed to the repository; array settings merge with Polygraph's generated allowlist rather than replacing it.
12
+
13
+ **If you are the Claude parent** — add writable paths to `.claude/settings.json` (or `.claude/settings.local.json`):
14
+
15
+ ```json
16
+ { "sandbox": { "filesystem": { "allowWrite": ["<path>"] } } }
17
+ ```
18
+
19
+ The `.claude/` directory is read-only inside the sandbox, so give the user the exact snippet to commit — you cannot apply it yourself.
20
+
21
+ **If you are the Codex parent** — add writable roots or network access to `.codex/config.toml`:
22
+
23
+ ```toml
24
+ [sandbox_workspace_write]
25
+ network_access = true
26
+ writable_roots = ["<path>"]
27
+ ```
28
+
29
+ The `.codex/` directory is read-only inside the sandbox, so give the user the exact snippet to commit — you cannot apply it yourself.
30
+
31
+ 2. **Turn sandboxing off.** The user quits the agent, runs `polygraph config`, toggles **Agent Options → Claude** (or **→ Codex**) **→ sandbox** off (or per-repo under **Repo Options**), and relaunches the Polygraph session. Non-interactive alternative: set `agentOptions.claude.sandbox: false` (or `agentOptions.codex.sandbox: false`, or `repoOptions."org/repo".sandbox: false`) in `~/.polygraph/config.json`. Warn that this removes filesystem isolation — the agent can then write anywhere the OS user can.
32
+
33
+ **Never blame the tooling.** A sandbox denial means the environment blocked the operation — not that the repo, tool, or framework is broken. Do not record conclusions like "X is unusable" in memory, session descriptions, or messages based on sandboxed failures.
@@ -0,0 +1,9 @@
1
+ # Fetching Git History for Shallow Clones
2
+
3
+ Session repos are shallow (`--depth 1`) clones, and plain `git fetch --unshallow` fails on private repos (the clone-time credential is not retained).
4
+
5
+ When git fails on missing history — `bad object` from `git revert`, `git log`, `git blame`, etc. — call `git_fetch({ sessionId, repo })` (CLI: `polygraph git fetch <repo> --session <id> --json`), then retry the git command.
6
+
7
+ - Defaults fetch the default branch's full history.
8
+ - Pass `depth` for a bounded fetch, or `refs` to include extra branches.
9
+ - Safe to call redundantly — returns `alreadyComplete: true` when the history is already present.