Repository navigation
fix(agents): keep the github_publish tool listing stable across turn kinds - #184144
Conversation
Derive GitHub tool definitions from host and workspace capabilities instead of current operator authority. Keep continuation guidance stable across scheduled and senderless turns while preserving Gateway identity, target, and permission checks at execution. Add operator/wake/cron/heartbeat prefix regressions, update capability and inheritance coverage, and document the listing contract. Verified red on the base; all touched test files pass twice on the box, with GitHub authorization sibling coverage and clean oxfmt/oxlint checks.
|
🦞👀 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 changesThis PR keeps GitHub publication tool definitions stable across turn kinds while preserving Gateway authorization. Example: A conversation with githubPublicationAvailable=false receives a senderless subagent completion after an operator turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current prompt-prefix contract violation with a focused simplification, and no actionable correctness or security finding was identified. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAgent tool assembly combines session capabilities, workspace support, and configured policy into provider-facing definitions; calls go through the existing Gateway publication owner for current identity, target, and permission checks. flowchart LR
A[Session capabilities] --> C[Agent tool assembly]
B[Workspace and configuration] --> C
C --> D[Stable provider catalog]
D --> E[Tool invocation]
E --> F[Gateway authorization]
F --> G[GitHub operation]
Technical reviewBest possible solution: Use session and workspace facts for discovery and retain current-caller authorization in the existing Gateway action owner. Do we have a high-confidence way to reproduce the issue? Current main directly shows the divergent listing path, and the PR records matching red-on-base regression results; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch fixes the listing producer by deleting per-turn variants, preserves workspace capability filters and schema reuse, and adds focused coverage without new production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b0f321730dc1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -42, Tests +1, Docs +7. Total -34 across 9 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 25, 2026, 11:31 PM ET / October 26, 2026, 03:31 UTC. |
|
Merged via squash.
|
…84144) Derive GitHub tool definitions from host and workspace capabilities instead of current operator authority. Keep continuation guidance stable across scheduled and senderless turns while preserving Gateway identity, target, and permission checks at execution. Add operator/wake/cron/heartbeat prefix regressions, update capability and inheritance coverage, and document the listing contract. Verified red on the base; all touched test files pass twice on the box, with GitHub authorization sibling coverage and clean oxfmt/oxlint checks.
…claw#184373) Assert stable GitHub schemas and independently reject unauthorized inspect and merge calls on top of openclaw#184366. Accept empty optional exec-completion finals without delivery claims. Correct stale tool-authority documentation. Follow-up to the contracts established by openclaw#184144 and openclaw#184005.
What Problem This Solves
The
github_publishtool's definition could differ between turns of the same session. Operator and channel turns listed the full tool with PR actions. Senderless turns (subagent announce, requester settle, cron, heartbeat) lacked session-control authority, so they got a reduced schema and description, or no tool at all in the action-only configuration. Each such flip changed the tool definitions sent to the provider mid-session, which breaks the prompt-prefix contract and the prompt cache.User Impact
GitHub publication tools keep the same definition throughout a session, preserving prompt caching across operator, scheduled, and senderless turns. Existing Gateway authorization continues to control every action; no configuration changes or migration are required.
Why This Change Was Made
Root cause
src/agents/openclaw-tools.tsderivedgithubActionsAvailablefromhasSessionControlAuthority(options.sessionControlAuthority), a per-turn authority fact. It used that to decide both whether the tool is listed and which schema and description variantgithub-publish-tool.tsrenders. Per-turn authority belongs at call time (AGENTS.md prompt-prefix rule), not in the listing.Fix
Listing now depends only on the session-owned
githubPublicationAvailablefact. The tool always renders one schema and description for a given session and config. Inspect, ready, merge, close and child-selection actions stay gated at the point of effect by the existing Gateway checks, including full operator write access insrc/gateway/github-publication-actions.ts, so no authority check is removed. The per-turn availability plumbing and description variants are deleted. Prompt-caching docs updated.Evidence
agent-tools.prefix-stability.test.tscases comparegithub_publishdefinitions and Code Mode catalogs across operator/channel, announce, settle, cron and heartbeat turns. They fail on base (2 failed / 13: changed definitions with publication enabled, and a missing tool in the action-only case) and pass with the fix.