Skip to content

fix: skip extra approval for comments on the session PR - #206129

Merged
daniel-lxs merged 5 commits into
mainfrom
openclaw/roboclaw-comment-approval-timeout-c8d0ec
Nov 27, 2026
Merged

daniel-lxs merged 5 commits into
mainfrom
openclaw/roboclaw-comment-approval-timeout-c8d0ec

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #206119

What Problem This Solves

Agents need a separate confirmation to comment on the PR their current session is already working on, even though creating that PR needs no such confirmation. For comments on other targets, Codex can cancel the required five-minute approval after only 90 seconds.

User Impact

Comments on the session's selected or currently published PR post without another approval. Comments on other issues or PRs in the registered repository still require approval of the exact target, posting account and text, and retain their full five-minute lifetime. The tool still cannot choose another repository. No configuration change is needed.

Why This Change Was Made

I use the existing session PR association, or its current publication receipt when there is no selected PR, with an exact host/repository/PR match. The exception does not cover every PR authored by the selected account. Session/project access, publisher identity checks, comment outcome logging and unconfirmed-write handling stay intact.

I also reuse the existing getExecutionTimeoutMs contract. The GitHub tool declares its ten-minute dispatch budget for comment creation, and Codex honors declared tool budgets with completion grace. Parent cancellation and approval expiry stay in force for other targets.

I ran pr-simplify without introducing another setting, state store or permission mechanism. Against the base, production changes are +75/-39 lines and tests are +122/-1 lines, plus the documentation update. The regression shares the existing publication fixture and covers both supported sources of the session PR.

Evidence

Live Gateway verification at 9419697b9aa8c0547bfbaaf969a8221b24ac8379

An isolated OpenClaw Gateway with a real model exercised all three cases on November 27, 2026 UTC.

  • Selected PR: The model posted one GitHub comment on the session's selected PR. The Gateway issued zero approval requests.
  • PR published by the session: The model posted one GitHub comment on the PR identified by the session's publication receipt. The Gateway issued zero approval requests.
  • Different target: The Gateway issued one approval request when the selected-PR session targeted a different PR in the same repository. GitHub showed zero matching comments while approval was pending and exactly one after the operator chose Allow once.

GitHub readback confirmed the posting account and one comment per case, with zero duplicate writes.

Automated checks

For the exemption, both new regressions failed without the change. AWS VM checks passed 131 focused tests across the publication action, comment, tool-description and Codex watchdog consumers. Formatting, targeted lint, core and test typechecks passed. The checks cover the session's published and selected PRs, other-target consent, and host/repository mismatches. GitHub transport is mocked in these regressions; they are not live-model proof.

Local autoreview remains unavailable because the selected Codex installation cannot execute inside its read-only review sandbox. I did not relax the sandbox.

Earlier live proof of the retained watchdog fix

I’m including the redacted real-Gateway Codex verification supplied by @daniel-lxs for head 9e9ec40:

Head 9e9ec40 | Codex harness | github_publish.create_comment | approval TTL 300000 ms
Allow  | prior run | pending at 96100 ms | allowed | confirmed GitHub comments=1
Deny   | pending at 96027 ms | plugin.approval.resolve accepted | denied/user at 96073 ms | resolver=runtime
Expiry | pending at 96009 ms | no decision submitted | expired/timeout at 300002 ms | resolver=system
Stop   | pending at 96008 ms | chat.abort accepted (aborted=true) | cancelled/run-aborted at 96149 ms | resolver=system
Deny, Expiry, Stop | GitHub write attempts=0 | disposable PR comments 0 -> 0
  • The reported plain-Gateway reproduction on main 36395007cf0 used a real model through Codex. The approval was system-cancelled after 89.998 seconds with 210 seconds remaining.
  • I ran both focused files on an AWS VM with Node 24.22.1. Without the production fix, both regressions failed, including the exact 90000ms watchdog result. With the fix, all 57 tests passed across both files.
  • The fake-clock watchdog regression completes after 310 seconds, past the approval lifetime, under the declared operation budget. The producer check protects the comment budget and unchanged readiness default.
  • I verified the final file hashes against the VM-tested source. Formatting, targeted lint and the core typecheck passed with no warnings or errors.
  • Local autoreview was unavailable: the installed Codex executable could not run inside its read-only review sandbox. I did not weaken that sandbox. I did not independently repeat the supplied live-model replay.

Cleanup: AWS test leases were released and prior proof scratch was removed. No Team Gateway configuration or consent setting was changed.

Contributor: Dan Riccio (@daniel-lxs).

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

🦞 Made with OpenClaw

roboclaw-bot and others added 2 commits November 26, 2026 19:36
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 604880fa-6341-4ca2-becd-a96804b76f6d
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR skips separate approval for comments on the session’s PR and preserves the full approval lifetime for other targets under Codex.

Example: The session selects #7 and calls create_comment with issueNumber 7.

  • Before: Posting requires another approval, which Codex can cancel after 90 seconds.
  • After: The comment posts without separate approval; other targets still require consent.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused implementation with shipped-entry-point evidence, distinct regression coverage, and no identified correctness or security defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The updated public body records real-model Gateway verification at the reviewed head for selected PR, published PR, and approved other-target posting; credited earlier Codex output covers allow, deny, expiry, and Stop on unchanged watchdog code, resolving the prior rank-up request.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users lose valid comment approvals before their deadline and must separately approve comments on the PR their session is already working on.
Reason: The timeout violates the advertised approval lifetime, and the collaborator-authored direction explicitly approves the narrowly scoped consent change.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for landing: it fixes the premature approval timeout and implements the maintainer-approved session-PR exception without an identified defect.

Reviewed head: 9419697b9aa8c0547bfbaaf969a8221b24ac8379

Before merge

None.

Findings

None.

Agent review details

How this fits together

The GitHub tool sends comment intent to the Gateway, which resolves the registered repository, session PR, requester access, and publisher before posting through GitHub and returning a verified URL.

flowchart TD
  A[Agent GitHub tool] --> B[Codex execution budget]
  B --> C[Gateway access and publisher checks]
  C --> D[Session PR match]
  D -->|Match| F[GitHub comment POST]
  D -->|Other target| E[Exact comment approval]
  E -->|Allow once| F
  F --> G[Verified result and outcome log]
Loading

Technical review

Best possible solution:

Land the focused change using the existing session association, publication receipt, approval manager, and tool-owned execution budget.

Do we have a high-confidence way to reproduce the issue?

Current-main source applies the ordinary 90000 ms Codex watchdog to a comment operation whose approval lasts 300000 ms, matching the reported live failure in #206119; no target code was executed during this review.

Is this the best way to solve the issue?

The implementation fixes the timeout at its existing budget owner and keeps the consent exception inside the Gateway’s existing comment owner without introducing parallel state or permission mechanisms.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f769a88c6a4f.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main necessity: The introduced hunks add the session-PR exception and generalize the existing tool-owned timeout contract; comparison with fetched main confirms both changes remain absent there. (src/gateway/github-publication-issue.ts:150, 9419697b9aa8)
  • Approval boundary: The exception requires the full selected or published PR URL to match the configured host, registered repository, and requested number; conversation write access, project eligibility, publisher validation, and uncertain-write handling remain in the production path. (src/gateway/github-publication-issue.ts:338, 9419697b9aa8)
  • Timeout ownership and cancellation: Comment creation declares the existing 600000 ms dispatch budget; Codex adds completion grace while retaining its parent abort listener and forwarding cancellation to the tool. (extensions/codex/src/app-server/dynamic-tool-execution.ts:426, 9419697b9aa8)
  • Updated live proof resolves prior review gap: The current public body records isolated real-model Gateway runs at the reviewed head: selected and published session PRs each received one comment without approval, while another target remained unchanged until Allow once; GitHub readback verified account and comment counts. (9419697b9aa8)
  • Retained watchdog proof: Dan Riccio’s supplied Gateway output records approval surviving beyond 90 seconds, successful allow, denial, five-minute expiry, and Stop without writes; the watchdog and tool production files are identical between that proved head and the reviewed head. (extensions/codex/src/app-server/dynamic-tool-execution.ts:409, 9419697b9aa8)
  • Regression coverage and checks: Added regressions separately cover selected and published PRs, other targets, host and repository mismatches, timeout-budget production, and non-node watchdog consumption; the body reports base failures and passing focused checks, and captured exact-head checks have no failures. (src/gateway/github-publication-actions.test.ts:54, 9419697b9aa8)

Likely related people:

  • Daniel: Raw commit 8df77eb adds src/gateway/github-publication-issue.ts:307 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8df77ebc6c40; files: src/gateway/github-publication-issue.ts)
  • Peter Steinberger: Raw commit 6872be8 adds extensions/codex/src/app-server/dynamic-tool-execution.ts:514 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6872be8c264d; files: extensions/codex/src/app-server/dynamic-tool-execution.ts)

PR surface

Source +36, Tests +121, Docs +4. Total +161 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 75 39 +36
Tests 3 122 1 +121
Docs 1 6 2 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 203 42 +161

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #206119
Summary: This PR supplies the timeout repair for the linked report and also implements the approved session-PR consent exception.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • merge-risk: 🚨 security-boundary: This PR intentionally removes per-comment consent for the session PR; its maintainer-authored direction accepts that narrow tradeoff while retaining requester, project, publisher, and other-target approval checks.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-11-26T19:57:49.586Z sha 9e9ec40 :: passed. :: none
  • reviewed 2026-11-26T20:09:55.363Z sha 9e9ec40 :: passed. :: none
  • reviewed 2026-11-26T20:50:49.856Z sha 9e9ec40 :: passed. :: none
  • reviewed 2026-11-27T06:05:34.591Z sha 9419697 :: passed. :: none

Reviewed November 27, 2026, 1:34 AM ET / 06:34 UTC (Revision 5).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 26, 2026 20:42
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 26, 2026
roboclaw-bot and others added 2 commits November 27, 2026 03:38
Keep approval for other targets in the registered repository and preserve comment outcome logging.

Co-authored-by: daniel-lxs <[email protected]>
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: d5ffe864-4859-46ed-9f32-003110590add
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime and removed size: S labels Nov 27, 2026
@roboclaw-bot roboclaw-bot changed the title fix: keep GitHub comment approvals alive fix: skip extra approval for comments on the session PR Nov 27, 2026
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Nov 27, 2026
@daniel-lxs

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 27, 2026
@daniel-lxs
daniel-lxs merged commit 30b6ab4 into main Nov 27, 2026
145 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/roboclaw-comment-approval-timeout-c8d0ec branch November 27, 2026 07:26
vincentkoc added a commit that referenced this pull request Nov 27, 2026
…restoration-ci-189390-20261127

* commit '6feeb50a3f14fbf0aa5167d342f186dc4d67fc18': (9846 commits)
  fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341)
  refactor(codex): centralize native completion delivery (#206447)
  fix(subagents): finish claimed stops after session rotation (#206405)
  fix: let owners fork a chat with exec after a subagent or exec completion (#206483)
  test(cli): gate agent --local cold-start processes and workers (#206466)
  perf(ci): skip baseline inventory when line-cap debt is empty (#189909)
  refactor(test): share core process-result fixtures (#174149)
  refactor(ci): reuse canonical budget flag parsing (#189480)
  fix: recover Codex chats after oversized requests (#206475)
  fix(agents): skip the bootstrap ritual in one-shot runs (#206477)
  fix(test): preserve stack coordinates in redacted failure reports (#152384)
  fix(gateway): return consistent unavailable response guidance (#191933)
  fix: preserve emphasis in Markdown table row labels (#205349)
  fix(nextcloud-talk): keep webhook spool helpers private (#206470)
  perf(plugins): overlay native receipts once per visible root (#206464)
  fix: keep GitHub comment approvals alive and skip repeat approval on the session PR (#206129)
  perf(config): retain one snapshot for unchanged validation results (#206465)
  refactor(test): reuse canonical secret fixture cleanup (#189492)
  refactor(subagents): own descendant Stop cancellation (#206444)
  refactor(subagents): keep announce cleanup action type private (#206407)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…the session PR (openclaw#206129)

Allow a session to comment on its selected or published pull request without a second approval. Keep explicit approval for other targets and let Codex honor the GitHub tool's execution budget so those approvals can run for their full lifetime.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: codex gateway Gateway runtime impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub comment approvals are cancelled before their five-minute deadline

2 participants