Repository navigation
fix: hide sandbox-only github_publish actions from direct sessions - #178671
Conversation
refresh_base and upload_evidence only work from a capable sandbox, but github_publish offered them to every publishing session. A direct session that called refresh_base got a refusal that read like a lost sandbox and stopped instead of merging the base with git. One predicate per action now decides both tool visibility and Gateway enforcement, and the refusals name the next step.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs maintainer review before merge. What this changesHide sandbox-only GitHub publication actions from sessions that cannot execute them, using shared capability checks. Example: An agent with sandbox mode off needs to update its PR branch from main.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a verified mismatch between advertised tools and supported sandbox capabilities, with no concrete introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAgent tool construction consumes the prepared sandbox context and exposes publication actions; Gateway handlers enforce workspace eligibility and current authorization before filesystem or GitHub effects. flowchart TD
A[Prepared sandbox context] --> B[Shared capability predicates]
B --> C[Publication tool schema]
C --> D[Agent action]
D --> E[Gateway publication handlers]
B --> E
E --> F[Workspace and GitHub operations]
Technical reviewBest possible solution: Use the shared sandbox predicates to keep publication schemas, instructions and Gateway eligibility aligned. Do we have a high-confidence way to reproduce the issue? Current-main source shows both actions advertised without sandbox eligibility and rejected by their Gateway owners; no target code was executed during this read-only review. Is this the best way to solve the issue? The smallest complete fix is to share the existing eligibility conditions between discovery and enforcement; every introduced production hunk serves that invariant. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b7c858fcf245. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +32, Tests +109, Docs +7. Total +148 across 11 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 3:02 PM ET / 19:02 UTC. |
…penclaw#178671) refresh_base and upload_evidence only work from a capable sandbox, but github_publish offered them to every publishing session. A direct session that called refresh_base got a refusal that read like a lost sandbox and stopped instead of merging the base with git. One predicate per action now decides both tool visibility and Gateway enforcement, and the refusals name the next step.
What Problem This Solves
Fixes: agents running without a sandbox are offered
github_publishactionsrefresh_baseandupload_evidence, which only work inside a sandbox, so calling them fails with a refusal that reads like the session's sandbox is broken.User Impact
Direct (non-sandboxed) sessions no longer see
refresh_baseorupload_evidence. They keep publish, edit, ready, request_review and the operator actions unchanged. Sandboxed sessions are unaffected:refresh_basestill appears for a writable managed-worktree sandbox, andupload_evidencestill appears whenever the sandbox can read files with source provenance.Why This Change Was Made
Both actions arrived with #174532 (
refresh_base) and #176139 (upload_evidence). They are advertised to every session that can publish, but the Gateway accepts them only from a capable sandbox. In a real run with sandbox mode off, an agent hit that refusal ("Run refresh_base from this workspace's sandboxed agent ..."). It concluded the session had lost its sandbox and stopped a PR landing instead of merging the base with git, which is exactly what a direct session should do.One predicate per action now lives in
src/agents/sandbox/github-publication.ts. The same predicate decides tool visibility (schema enum, action-specific properties and description bullets) and Gateway enforcement, so the two can no longer drift apart. The Gateway refusals stay in place for non-tool callers and now say what to do instead. The sandbox context is a session/config fact, so the tool definition stays stable within a session.Evidence
src/agents/tools/github-publish-tool.test.tscovering direct, writable managed, read-only managed, unmanaged, missing-backend, missing-file-bridge, missing source-aware read and disabled sandboxes, with and without operator actions. It failed on the base (6 failed: e.g. direct sessionrefresh_base: expected true to be false) and passes with the fix (23/23).openclaw-tools.registration,github-publication-evidence,github-publication-base-refresh-actions,github-publication-workflows; prompt-prefix contractagent-tools.prefix-stabilitypasses.pnpm tsgo:coreandpnpm tsgo:core:testfor the changed paths pass. The core test shard root budget (advisory under GitHub Actions) already exceeds 720 roots on main; this change adds no test files.pnpm format:checkandgit diff --checkpass on the changed files. Local oxlint could not loadeslint-plugin-solidin this source-only worktree; CI lint covers it.