Skip to content

fix: start Gateway investigations with user auth on one tracker - #1847

Merged
RomneyDa merged 1 commit into
openclaw:mainfrom
RomneyDa:fix/gateway-monitor-single-tracker
Oct 23, 2026
Merged

RomneyDa merged 1 commit into
openclaw:mainfrom
RomneyDa:fix/gateway-monitor-single-tracker

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes Copilot handoff returning 401 user_context_required despite a valid configured user token, and removes the separate investigation-issue architecture.

Related: #1829. Follow-up to #1692 (feat: monitor upstream Gateway protocol changes nightly).

User Impact

One permanent issue, #1829, owns candidate fingerprints, task reservations/IDs, dispositions and monitor health. No new candidate or health issues. Human notes remain untouched; unchanged acknowledged findings do not launch nightly tasks.

Why This Change Was Made

Octokit's auth hook overwrites request-level Authorization headers. Agent Tasks calls now use a separately authenticated client while repository writes retain GITHUB_TOKEN. Task creation retains no-retry semantics and durable reservation checks.

Evidence

The original configured secret failed in run 39901023031, while direct access with the exact uploaded credential returned HTTP 200. Loopback proofs with real Octokit v7 and the actual actions/github-script@v9 bundle reproduced the old header overwrite and verified the injected client factory sends personal auth, keeps issue auth separate, and sends a failing task POST exactly once. All proof credentials were synthetic.

Change Type

  • Bug fix
  • Refactor
  • Tests or validation

Scope

  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • none: GitHub workflow/Node monitor changes only; no native app, installer, MXC or device behavior changed. Mandatory Windows build/Shared/Tray closeout is tracked below.

Validation

  • node --test .github/scripts/upstream-gateway-protocol.test.cjs .github/scripts/gateway-capabilities.test.cjs: 57 passed, 0 failed/skipped; auth regression fails against the original workflow for the missing separate client.
  • ./build.ps1: passed in Windows 11 ARM64 isolated snapshot (before final JS-only review fixes); prerequisites passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 4,639 passed, 3 failed, 27 skipped. Host failures: missing symlink privilege and two pwsh resolution cases.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: blocked, compilation exhausted VM disk. No executed-test claim.
  • ./scripts/validate-docs.ps1: passed as part of the Windows full build.
  • Independent shared autoreview P0-P3: two passes identified three findings (secondary-client retry defaults, closed legacy reservations, legacy closing-reference PRs); each fixed with regression coverage. Hosted final-head review remains required.

Real behavior proof

  • Source: 6b37b42f4; no native application source changed.
  • Environment: local loopback, real Octokit v7; Windows 11 ARM64 isolated source snapshot for required closeout.
  • Auth proof: old client overwrites personal header with workflow auth; independent client sends personal auth and leaves repository client unchanged.
  • Current-head live-data replay: the production publisher validated fresh upstream/package evidence and replayed the actual v1 bodies of Gateway capability tracking #1829/Investigate Gateway question-answer (9a9c182b64d1) #1845 with all writes intercepted. Existing open work deferred; a ready migration closure prepared Gateway capability tracking #1829; an ordinary closed acknowledgment stayed quiet; a closed unresolved reservation blocked new work. Human text outside the owned section was byte-preserved in every case. Actual PR context rejected handoff before any request. No issue/task was created by this proof.
  • Same-owner HTTP authority proof: actual actions/github-script@v9 executed current production publish() then handoff() through its real configured Octokit clients against a loopback HTTP fixture. Allowed case: exactly 1 task POST and persisted task ID. Tracker closed/reassigned or reservation replaced after durable reservation: 0 task POSTs in each case. All issue writes carried workflow auth; all task traffic carried personal auth; 0 new issues. Credentials and workflow event metadata were synthetic, immutable source responses were captured, and npm schema download/validation remained real. This is transport proof, not a hosted task claim.
  • Hosted current-head Shared: 4,661 passed, 8 skipped. Tray: 4,467 passed, none skipped. CI has one unrelated-input UI render timeout under investigation; remaining lanes are not claimed green yet.
  • Not verified / blocked: real configured-secret handoff requires deployment to the guarded default branch. It will be run immediately after landing. No task creation claim from mocks or HTTP lookup alone. The owner explicitly selected the existing personal CLI credential; this does not narrow that credential's existing GitHub permissions. This monitor still fixes its target to this repository. No personal credential was revoked, and no task was attempted in another repository.

Security Impact

  • No new permissions, secrets, repositories or endpoints.
  • Personal secret restricted to Agent Tasks API calls; issue operations retain the workflow token.
  • The action’s configured client factory inherits retries: 0. No automatic POST retry. Lost responses keep their reservation and require reconciliation.

Compatibility and Migration

After deployment, consolidate #1845 into #1829 only after confirming it has no task/reservation. Mark its closure as migration, not an acknowledged finding; retain the old evidence/comments. Closed legacy acknowledgments remain respected, and unresolved legacy reservations block duplicate work.

Review Conversations

  • Addressed all actionable current-head findings.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@RomneyDa RomneyDa added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 23, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR separates Agent Tasks authentication from repository authentication and consolidates investigation state and health on the permanent tracker.

Example: The enabled monitor investigates the question-answer candidate on tracker 1829.

  • Before: The workflow client's auth hook replaces the personal Authorization header, causing a reported 401 user_context_required response.
  • After: A separate client authenticates task requests with the configured user token while tracker writes retain workflow authentication.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused repair has real transport and migration evidence with no actionable findings; proof stops short of deployed configured-secret execution.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Current-head production publish/handoff ran through the actual github-script bundle and configured Octokit clients against real loopback HTTP: authorized creation persisted one task ID, closure/reassignment/reservation replacement prevented POSTs, issue/task credentials stayed separate, and a failing POST was sent once; existing v1 state was also replayed with preserved human text and legacy deduplication. The configured-secret hosted kickoff remains an explicitly accepted post-deployment check.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An enabled capability monitor publishes investigation evidence but cannot start its Agent Task despite a configured user credential.
Reason: The auth failure has concrete evidence, and the maintainer-authored PR explicitly chooses the single-tracker design and existing credential.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: current main still has the authentication defect, and the reviewed change has no actionable source findings.

Priority: P2
Reviewed head: 6b37b42f4035b935bb453cfe906a1cf6bedb86d8

Before merge

None.

Findings

None.

Agent review details

How this fits together

The GitHub Actions monitor turns validated upstream capability evidence into tracker state and a reserved Agent Tasks request, then records task progress and trusted dispositions.

flowchart TD
  A[Scheduled or publication event] --> B[Validate capability evidence]
  B --> C[Permanent tracker state]
  C --> D[Check existing work and reserve]
  D --> E[Recheck tracker authority]
  E --> F[User authenticated Agent Tasks client]
  F --> C
Loading

Technical review

Best possible solution:

Land the separate-client repair and consolidated tracker state, then perform the owner-recorded deployment check and reservation-safe legacy issue consolidation.

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

Current main passes a personal header through the workflow-authenticated client; the discussion records reproduction of its overwrite using real Octokit and the github-script bundle, consistent with the failed hosted handoff.

Is this the best way to solve the issue?

A separately authenticated client fixes the auth owner directly, and the maintainer-approved consolidation removes candidate-issue creation while preserving durable reservations and legacy blockers.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Agent Tasks authentication changes intended behavior with a stated reason (f5978f0: The monitor intentionally separated workflow-token issue operations from user-authorized task creation, but implemented task auth through a request header.)
  • Candidate issues, health reporting, and disposition ownership changes intended behavior with a stated reason (feat: monitor upstream Gateway protocol changes nightly #1692: Focused candidate issues held investigations while a fixed permanent tracker summarized them; the current maintainer direction consolidates this state and health without discarding legacy acknowledgments or reservations.)
  • No-replay task reservation keeps the original intent (f5978f0: Persisting a reservation before a non-idempotent task request prevents duplicate work after an uncertain response.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Karen: Raw commit f5978f0 adds .github/scripts/upstream-gateway-publish.cjs:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f5978f0f47aa; files: .github/scripts/upstream-gateway-publish.cjs)

Review metrics

Metric Value Why it matters
Production automation change +195 / -283 lines Consolidation removes more production machinery than it adds while retaining explicit reservation and authority checks.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a demonstrated maintainer automation failure without changing installed application behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 (3 earlier review cycles)
  • reviewed 2026-10-23T05:24:47.480Z sha 6b37b42 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T05:35:17.386Z sha 6b37b42 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T05:42:32.864Z sha 6b37b42 :: needs maintainer review before merge. :: none

Reviewed October 23, 2026, 1:46 AM ET / 05:46 UTC (Revision 4).

@RomneyDa

Copy link
Copy Markdown
Member Author

Current-head proof and review disposition for 6b37b42f4035b935bb453cfe906a1cf6bedb86d8:

  • 57 focused tests pass. The workflow wiring regression fails against the original workflow because no separate task client reaches handoff. The AuthClient case checks composition; it is not claimed as Octokit/network proof. Actual actions/github-script@v9 bundle proof separately exercised real auth hooks and the injected configured factory against loopback HTTP: old header overwritten, personal client authenticated independently, issue client unchanged, HTTP 500 task POST sent exactly once.
  • Production publish() replayed the existing live v1 issue bodies with fresh real upstream/schema validation and intercepted writes. Results: open Investigate Gateway question-answer (9a9c182b64d1) #1845 -> deferred; ready migration closure -> candidate-ready on Gateway capability tracking #1829 only; ordinary closed acknowledgment -> tracked/no new candidate; closed unresolved reservation -> deferred. Human notes were preserved byte-for-byte. No issue/task was created, and no live state was changed by this replay.
  • The actual PR context is rejected by handoff() before any request. Existing regressions also exercise tracker closure, reassignment and reservation replacement before POST, and preserve uncertain POST reservations without replay.
  • Current-head hosted Shared and Tray results: 4,661 and 4,467 passes respectively. The UI lane has one render timeout on unchanged native inputs; CI is not yet green.

The token choice is explicit maintainer direction: reuse the existing personal CLI credential for now. The monitor restricts its own target, not the account's token-wide GitHub permissions. Making a new task in another repository or revoking that working credential is not authorized proof and is not needed to change the client-auth owner. GitHub service-side credential revocation remains GitHub's contract; we do not claim to have tested revocation.

A genuine configured-secret handoff() creation can only be proved after this workflow is deployed to the guarded default branch. We will not spoof that authority for a premerge test. That last deployment check remains explicitly pending and will run immediately after landing, with its task receipt recorded on #1829. No merge or kickoff is claimed here.

The review found no definite introduced source bug. The migration and authentication evidence is now in the PR body; please reassess the proof-specific holds on that basis.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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 Oct 23, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Added the requested same-owner HTTP authority proof on unchanged head 6b37b42f4035b935bb453cfe906a1cf6bedb86d8.

The actual actions/github-script@v9 bundle executes production publish() followed by handoff() using its injected configured getOctokit. The clients send real HTTP to a loopback fixture; method bodies and auth hooks are not mocked. The fixture enforces different synthetic credentials for repository and Agent Tasks routes, uses captured immutable GitHub inputs and the existing v1 issue bodies, and leaves npm schema download/integrity verification real.

Boundary exercised after durable reservation Task POSTs Result
Authorized tracker unchanged 1 HTTP 201; returned task ID persisted on #1829 fixture
Tracker closed 0 Rejected by tracker validation
Tracker reassigned 0 Rejected by final authority check
Reservation replaced 0 Rejected by final authority check

All four cases created zero issues. Every issue PATCH used workflow authentication; every task request used personal authentication. The three negative mutations happen on the second task-list HTTP request, after reservation and before the final reread/POST. This directly exercises the final-effect boundary requested in the latest review.

No production issue/task writes occurred: credentials, event metadata and mutable service state were synthetic. This is not a claim of a hosted Copilot task. Real configured-secret kickoff remains the immediate post-deployment check, because the workflow intentionally permits it only on the default branch. Source and scope are unchanged; PR body now includes this proof.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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 Oct 23, 2026
@RomneyDa
RomneyDa merged commit c56b953 into openclaw:main Oct 23, 2026
78 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. 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.

1 participant