Skip to content

fix: Gateway monitor stalls after completed investigations - #1892

Merged
RomneyDa merged 3 commits into
openclaw:mainfrom
RomneyDa:fix/gateway-monitor-result-recovery-20261027
Oct 29, 2026
Merged

RomneyDa merged 3 commits into
openclaw:mainfrom
RomneyDa:fix/gateway-monitor-result-recovery-20261027

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: Gateway monitoring stalls when a completed investigation has not posted a result or upstream exceeds the watched-file budget.

Related: #1829 (Gateway capability tracking): the permanent tracker retains the recorded investigation and must stay open.

User Impact

Operators can recover the recorded completed investigation without starting new work. No Companion runtime behavior changes. Live tracker publication remains unproved. Merge and live proof remain explicitly blocked at the existing confidence gate despite green CI.

Why This Change Was Made

Read only the recorded task's bounded, candidate-bound final answer using the Copilot credential, then publish with the workflow credential. Retain final answers across empty usage frames, align delta admission with two complete 50,000-file inventories, and add manual pinned-task recovery without candidate selection or task creation. Normal monitoring and default-branch guards remain in place. The original contributor branch and commits are preserved; the maintainer patch is additive.

Evidence

Published head 43b308a2696722927fd8678c89f6989e581cdb97: all 73 monitor, capability and welcome tests pass locally. New regressions fail against the original production owners for the intended delta-budget and erased-final-answer defects. Recovery tests exercise lost-comment-response reconciliation, a quiet unchanged rerun, zero new tasks, and rejection of missing, mismatched, unfinished or unauthorized tasks.

Build and Test CI for this PR head completed successfully, including CI Gate, core/CLI, Tray/setup/integration, UI/functional/accessibility, all three selected WSL E2E lanes, and x64/ARM64 MSIX artifact checks. Official release/promotion jobs were intentionally skipped. This CI is not deployed monitor publication proof. No deployed monitor workflow has been dispatched.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • none: GitHub monitor scripts and workflow only; no custom Windows desktop, Gateway runtime, installer or device proof is claimed.

Validation

  • node --test .github\scripts\upstream-gateway-protocol.test.cjs .github\scripts\gateway-capabilities.test.cjs .github\scripts\welcome-content-notification.test.cjs: 73 passed, 0 failed, 0 skipped.
  • .\build.ps1: passed on Windows ARM64, including documentation validation.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 4,647 passed, 1 symlink-privilege failure and 26 skipped locally. Same failed test and counts on the original head; the failing owner and test are identical to the merge base.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 4,557 passed, 4 ARM64 prerequisite-fixture failures and 0 skipped locally. Same failed tests and counts on the original head; the build owner and tests are identical to the merge base. Neither local native suite is reported as passing; hosted lanes subsequently passed in the linked CI run.
  • .\scripts\validate-docs.ps1: passed, 66 Markdown files.
  • .\scripts\validate-agent-skills.ps1: passed, 13 skills and 22 Markdown files.
  • .\scripts\test-agent-skills-validator.ps1: passed, 27 fixtures and repository skills.
  • git diff --check: passed.
  • Independent exact-candidate reviews: Claude Opus 5.5 (high effort, default context) and GPT-6 Astra (high effort, long context) accepted both verified repairs; a third runtime-default reviewer (concrete model unverified) accepted the usage repair and recovery admission. No blocking code finding remains. Opus reported 91% code / 80% operational confidence; Astra reported 96% code / 88% operational confidence; the third gave qualitative high code confidence, not a numeric operational score. The three-reviewer operational 95% gate is not met. Green CI does not waive it.
  • Non-blocking review notes: retain explicit rejection of contradictory recovery/read-only inputs rather than silently skipping the job; preserve exact trusted-body deduplication pending real GitHub proof; keep the documented health-clear behavior consistent with normal successful publication. Speculative omitted-choice frame handling remains fail closed.
  • Hosted CI run 40762472430, head 43b308a2696722927fd8678c89f6989e581cdb97: completed success; CI Gate passed. Merge, deployed monitor dispatch and tracker result publication remain blocked.

Real Behavior Proof

  • Environment tested: local Windows ARM64; production monitor owners with synthetic external service responses. No GitHub publication or cloud task creation occurred during proof.
  • PR head or commit tested: 43b308a2696722927fd8678c89f6989e581cdb97.
  • Exact steps or command run: the three Node suites listed above invoke production sourceInventory, sourceChanges, validateReport, readTaskResult, publish and handoff; the recovery workflow's actual JavaScript step is also evaluated with controlled client inputs.
  • Evidence after fix: a 50,000-file initial baseline and 99,995 source deltas validate; a stopped final answer survives an empty-choices usage frame but not a later unfinished answer; recovery handles a lost comment response with one durable comment and acknowledgment and zero new task POSTs.
  • Observed result: 73 passed, 0 failed, 0 skipped. Synthetic service tests are not deployed publication proof.
  • Screenshot or artifact links verified? N/A. Earlier real read and nine-case Octokit loopback proof is recorded on the PR; it used original head f366e0f9, not the recovery-only candidate. It collected 10,119 watched files and retrieved a 1,273-character existing-work final answer through real read transports. The loopback cases showed one durable comment and acknowledgment after response loss, and no publication for wrong task/session/repository/candidate or revoked tracker authority. These earlier results remain attributed to that earlier source.
  • Not verified or blocked: deployed Actions-secret publication/deduplication and the operational confidence gate. No feature-branch route bypasses the default-branch guard. The proposed main-branch recovery check requires separate merge and live-write authority; neither is granted.

Security Impact

  • New permissions or capabilities? No new repository permission scope; the manual recovery job uses existing contents-read and issues-write scopes.
  • Secrets or tokens handling changed? Yes
  • New or changed network calls? Yes
  • Command or tool execution surface changed? Yes, a manual recovery-only dispatch mode.
  • Data access scope changed? Yes
  • If any answer is Yes, explain the risk and mitigation: an existing Copilot secret reads only a recorded completed task through allowlisted endpoints; the workflow token writes its validated result to the existing tracker. Recovery requires the exact recorded task ID, explicit manual inputs, the default branch and the enabled monitor. It cannot reserve/create tasks, choose a candidate or send welcome notifications. No secret is exposed to an agent shell.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? Optional manual dispatch inputs only; ordinary monitoring defaults are unchanged.
  • Migration needed? No
  • If yes, list the exact upgrade steps: none. After a separately authorized merge, a separately authorized recovery check can use main, report_only=false, recovery_only=true, and the then-recorded recovery_task_id; inspect the first run before dispatching the unchanged second run. This is a proposal, not permission to execute it.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Oct 27, 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 27, 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: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR recovers completed investigation answers onto the permanent tracker and raises the watched-source limit to 50,000 files.

Example: Task 214a1281-7646-4da9-a217-ae2e48d1ad50 completes without posting a tracker comment.

  • Before: The monitor records needs-disposition and cannot acknowledge the investigation.
  • After: The monitor retrieves its matching final answer, publishes it once, and records the existing-work disposition.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with live-read and real-client publication evidence, no actionable source findings, and a separate unresolved CI gate.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): At the reviewed head, production collection and result retrieval exercised real GitHub/npm/Copilot transports; production publish and handoff exercised real Octokit clients over loopback HTTP, showing one durable result after response loss and zero publication or acknowledgment for mismatched or revoked tracker authority. Configured Actions-secret publication remains a disclosed deployment follow-up.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators lose investigation results and nightly collection stops after upstream exceeds the existing file budget.
Reason: The maintainer-authored repair addresses observed operational failures within the existing monitor design and adds no configuration or Companion behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes two current monitor failures; source review found no actionable defect, while the failed UI gate remains unclassified.

Priority: P2
Reviewed head: f366e0f996bc603a5ead6d089e42d5eca3926f53

Before merge

None.

Findings

None.

Agent review details

How this fits together

The GitHub Actions monitor collects upstream source and schema evidence, tracks investigation reservations, and publishes completed Copilot results to the permanent issue using separate read and write credentials.

flowchart LR
  A[Upstream evidence] --> B[Collector and validator]
  B --> C[Permanent tracker]
  C --> D[Investigation handoff]
  D --> E[Copilot task and session]
  E --> F[Bounded final answer reader]
  F --> G[Workflow comment publication]
  G --> C
Loading

Technical review

Best possible solution:

Recover bounded, task-bound final answers through the existing handoff while preserving tracker authority, reservations, credential separation, and deduplication.

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

Current main rejects inventories above 10,000 watched files and cannot recover a completed task without a trusted comment; the live tracker exhibits the latter state, and the author reports both regressions failing before the fix.

Is this the best way to solve the issue?

The focused reader is justified by the distinct authenticated log transport, while publication and durable decisions remain in the existing owner; the added tests protect distinct collection, identity, parsing, and reconciliation failures.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Source inventory and report bounds keeps the original intent (f5978f0: The original monitor required complete, bounded upstream inventories before authorizing investigation.)
  • Completed-task disposition and publication keeps the original intent (c56b953: The single-tracker repair kept reservations and dispositions durable while separating personal task access from workflow issue writes.)
  • Agent reporting instructions changes intended behavior with a stated reason (f5978f0: Investigations were instructed to post a fingerprint-bound disposition; this PR explains that completed agents may lack shell authentication and delegates publication to the monitor.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Karen: Raw commit f5978f0 adds .github/scripts/upstream-gateway-protocol.cjs:84 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-protocol.cjs)

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The failures stall repository capability monitoring and investigation reconciliation without changing Companion runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • 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 (2 earlier review cycles)
  • reviewed 2026-10-27T19:00:15.616Z sha f366e0f :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T19:08:16.594Z sha f366e0f :: needs maintainer review before merge. :: none

Reviewed October 27, 2026, 3:13 PM ET / 19:13 UTC (Revision 3).

@RomneyDa

Copy link
Copy Markdown
Member Author

Current-head publication boundary proof

Head: f366e0f996bc603a5ead6d089e42d5eca3926f53. The production publish(), handoff(), and result reader ran through real @octokit/rest 22.0.1 clients and production fetch against an owned loopback HTTP server. Only external services were fixtures; owner logic and state transitions were unchanged. Synthetic workflow and personal credentials were asserted independently on every HTTP request. No GitHub writes or cloud task creation occurred in this harness.

Scenario Comment POSTs Durable comments Acknowledgments Task POSTs Result
allowed 1 1 1 0 PASS
lost-response 1 1 1 0 PASS
wrong-task 0 0 0 0 PASS
wrong-session-task 0 0 0 0 PASS
wrong-repository 0 0 0 0 PASS
wrong-candidate 0 0 0 0 PASS
closed 0 0 0 0 PASS
reassigned 0 0 0 0 PASS
reservation-replaced 0 0 0 0 PASS

Allowed and lost-response cases include repeated handoff() / publish() reconciliation. The lost-response server persists the comment and then returns HTTP 503; recovery retains one comment and one acknowledgment. Closed/reassigned/replaced-reservation cases mutate tracker authority while the result body is being retrieved. Mismatches reject before publication and durable acknowledgment. Human tracker prose survives.

This transport proof supplements, not replaces, live collection (10,119 files) and real existing-task retrieval (1,273-character existing-work final answer). The post-merge workflow will prove the configured Actions secret and real GitHub publication, followed by an unchanged rerun to check deduplication.

Hosted Windows proof on this head: Shared 4,666 passed / 0 failed / 8 permitted skips; Tray 4,561 passed / 0 failed / 0 skipped. The UI lane timed out; investigation and a bounded rerun remain pending. Other still-running lanes remain pending.

Reproduction harness (synthetic external services only)

Run from the PR checkout with Node 22+, after installing @octokit/rest@22 into /tmp/gateway-monitor-octokit-20261027. Generate /tmp/gateway-monitor-live-report-20261027/report.json with the production collector first (read-only upstream evidence). The harness reads that report, rebinds its local assessment to the checkout, verifies the exact npm tarball digest, then sends all proof calls through the loopback server. It does not load real credentials.

import assert from 'node:assert/strict';
import http from 'node:http';
import fs from 'node:fs';
import { createRequire } from 'node:module';
import { execFileSync } from 'node:child_process';
import { Octokit } from '/tmp/gateway-monitor-octokit-20261027/node_modules/@octokit/rest/dist-src/index.js';
const root=process.cwd();
const require=createRequire(root+'/package.json');
const monitor=require(root+'/.github/scripts/upstream-gateway-protocol.cjs');
const publisher=require(root+'/.github/scripts/upstream-gateway-publish.cjs');
const report=JSON.parse(fs.readFileSync('/tmp/gateway-monitor-live-report-20261027/report.json','utf8'));
report.capabilities=monitor.assessLocal(report);
report.fingerprint=monitor.fingerprint(report);
monitor.validateReport(report);
const realFetch=globalThis.fetch;
const metadata=await (await realFetch(`https://registry.npmjs.org/${encodeURIComponent(report.protocol.name)}/${report.protocol.version}`)).json();
const tarball=Buffer.from(await (await realFetch(metadata.dist.tarball)).arrayBuffer());
assert.equal(monitor.hash(tarball),report.protocol.tarballHash);
const tree={truncated:false,tree:Object.entries(report.main.files).map(([path,e])=>({path,type:'blob',sha:e.sha}))};
const family=report.capabilities.families.find(f=>f.id==='question-answer');
const taskId='214a1281-7646-4da9-a217-ae2e48d1ad50';
const sessionId='00e29dc1-0a8e-4559-97d4-681b4c112703';
const context={repo:{owner:'openclaw',repo:'openclaw-windows-node'},runId:999,eventName:'workflow_dispatch',ref:'refs/heads/main',payload:{repository:{default_branch:'main'},inputs:{report_only:false}}};
let state;
const readState=()=>JSON.parse(state.tracker.body.match(/<!-- upstream-gateway-state:v2:(.*) -->/)[1]);
const writeState=value=>{state.tracker.body=state.tracker.body.replace(/<!-- upstream-gateway-state:v2:.* -->/,'<!-- upstream-gateway-state:v2:'+JSON.stringify(value)+' -->');};
const server=http.createServer(async(req,res)=>{
 try {
  const origin=req.headers['x-proof-origin'];
  const url=new URL(req.url,'http://127.0.0.1');
  const p=url.pathname;
  const taskAuth=origin==='https://api.individual.githubcopilot.com'||p==='/graphql'||p.startsWith('/agents/');
  const expected=origin==='https://registry.npmjs.org'?undefined:origin==='https://api.individual.githubcopilot.com'?'Bearer personal-proof-token':taskAuth?'token personal-proof-token':'token workflow-proof-token';
  assert.equal(req.headers.authorization,expected,'credential crossed the service boundary');
  state.requests++;
  const chunks=[]; for await(const c of req)chunks.push(c);
  const body=chunks.length?JSON.parse(Buffer.concat(chunks).toString()):null;
  const send=(data,status=200)=>{res.writeHead(status,{'content-type':'application/json'});res.end(JSON.stringify(data));};
  if(origin==='https://registry.npmjs.org') {
   if(p.endsWith('.tgz')){res.writeHead(200,{'content-type':'application/octet-stream'});res.end(tarball);}else send(metadata);return;
  }
  if(origin==='https://api.individual.githubcopilot.com') {
   assert.equal(p,`/agents/sessions/${sessionId}/logs`);
   assert.equal(req.headers['copilot-integration-id'],'copilot-4-cli');
   if(state.scenario==='closed')state.tracker.state='closed';
   if(state.scenario==='reassigned')state.tracker.assignees=[{id:1234}];
   if(state.scenario==='reservation-replaced'){const value=readState();value.current.task.reservation='c'.repeat(64);writeState(value);}
   const hash=state.scenario==='wrong-candidate'?'b'.repeat(64):family.candidateHash;
   const text='Existing work owns the question implementation. Scope negotiation and real Gateway tests remain outstanding.\n'+`<!-- upstream-gateway-disposition:v1:${hash}:existing-work -->`;
   res.writeHead(200,{'content-type':'application/json,text/event-stream'});
   res.end('data: '+JSON.stringify({id:'turn-final',object:'chat.completion.chunk',choices:[{delta:{role:'assistant',content:text},finish_reason:'stop'}]})+'\n');return;
  }
  if(p==='/graphql'){send({data:{viewer:{copilotEndpoints:{api:'https://api.individual.githubcopilot.com'}}}});return;}
  if(p.startsWith('/repos/openclaw/openclaw/compare/')){send({status:'identical',base_commit:{sha:report.main.commit}});return;}
  if(p.startsWith('/repos/openclaw/openclaw/git/trees/')){send(tree);return;}
  const repo='/repos/openclaw/openclaw-windows-node';
  if(p===repo+'/issues/1829/comments'){
   if(req.method==='GET'){send(state.comments);return;}
   assert.equal(req.method,'POST');state.commentPosts++;
   const comment={id:state.comments.length+1,body:body.body,user:{id:41898282},author_association:'CONTRIBUTOR'};
   state.comments.push(comment);
   if(state.scenario==='lost-response'&&state.commentPosts===1){send({message:'synthetic response loss after persistence'},503);return;}
   send(comment,201);return;
  }
  if(p===repo+'/issues/1829'){
   if(req.method==='PATCH')state.tracker.body=body.body;
   send(state.tracker);return;
  }
  if(p===repo+'/issues'){send(url.searchParams.has('labels')?[]:[state.tracker]);return;}
  if(p===repo+'/pulls'){send([]);return;}
  if(p===`/agents/repos/openclaw/openclaw-windows-node/tasks/${taskId}`){send(state.task);return;}
  if(p==='/agents/repos/openclaw/openclaw-windows-node/tasks'&&req.method==='POST')state.taskPosts++;
  throw new Error(`Unexpected transport route: ${req.method} ${origin}${p}`);
 } catch(e) {state.serverErrors.push(e.message);res.writeHead(500,{'content-type':'application/json'});res.end(JSON.stringify({message:e.message}));}
});
await new Promise(resolve=>server.listen(0,'127.0.0.1',resolve));
const local=`http://127.0.0.1:${server.address().port}`;
globalThis.fetch=async(input,init={})=>{
 const url=new URL(typeof input==='string'?input:input.url??String(input));
 assert.ok(['https://api.github.com','https://api.individual.githubcopilot.com','https://registry.npmjs.org'].includes(url.origin));
 const headers=new Headers(init.headers);headers.set('x-proof-origin',url.origin);
 return realFetch(local+url.pathname+url.search,{...init,headers});
};
const github=new Octokit({auth:'workflow-proof-token',request:{fetch:globalThis.fetch},log:{debug(){},info(){},warn(){},error(){}}});
const copilot=new Octokit({auth:'personal-proof-token',request:{fetch:globalThis.fetch},log:{debug(){},info(){},warn(){},error(){}}});
const core={info(){}};
const results=[];
try {
 for(const scenario of ['allowed','lost-response','wrong-task','wrong-session-task','wrong-repository','wrong-candidate','closed','reassigned','reservation-replaced']){
  const initial={current:{id:family.id,candidateHash:family.candidateHash,contractHash:family.contractHash,runId:999,
   task:{state:'queued',reservation:'a'.repeat(64),taskId}},acknowledged:[],health:null};
  state={scenario,requests:0,commentPosts:0,taskPosts:0,comments:[],serverErrors:[],tracker:{number:1829,state:'open',labels:[],assignees:[],
   body:'Human notes preserved.\n<!-- upstream-gateway-tracker:v1 -->\n<!-- upstream-gateway-owned:begin -->\n<!-- upstream-gateway-state:v2:'+JSON.stringify(initial)+' -->\n<!-- upstream-gateway-owned:end -->'},
   task:{id:taskId,state:'completed',created_at:'2026-10-23T06:55:36Z',session_count:1,repository:{id:1144728715},sessions:[{id:sessionId,task_id:taskId,state:'completed',repository:{id:1144728715}}]}};
  if(scenario==='wrong-task')state.task.id='other-task';
  if(scenario==='wrong-session-task')state.task.sessions[0].task_id='other-task';
  if(scenario==='wrong-repository')state.task.sessions[0].repository.id=9999;
  const invoke=()=>publisher.handoff({github,copilot,context,core,report,issueNumber:1829});
  const publish=()=>publisher.publish({github,context,core,report,createWork:false});
  let error=null;
  if(scenario==='allowed'||scenario==='lost-response'){
   if(scenario==='lost-response')await assert.rejects(invoke(),/synthetic response loss/);
   await invoke();await publish();await invoke();await publish();
   assert.equal(state.commentPosts,1);assert.equal(state.comments.length,1);
   assert.equal(readState().current.task.disposition,'existing-work');
   assert.deepEqual(readState().acknowledged,[family.candidateHash]);
   assert.match(state.tracker.body,/Human notes preserved/);
  }else{
   try{await invoke();}catch(e){error=e.message;}
   assert.ok(error,scenario+' must reject');
   assert.equal(state.commentPosts,0);assert.equal(state.comments.length,0);
   assert.equal(readState().current.task.disposition,undefined);
   assert.deepEqual(readState().acknowledged,[]);
  }
  assert.equal(state.taskPosts,0);assert.deepEqual(state.serverErrors,[]);
  results.push({scenario,requests:state.requests,commentPosts:state.commentPosts,comments:state.comments.length,acknowledgments:readState().acknowledged.length,taskPosts:state.taskPosts,error,result:'PASS'});
 }
 const receipt={head:execFileSync('git',['rev-parse','HEAD'],{cwd:root,encoding:'utf8'}).trim(),transport:'real @octokit/rest 22.0.1 plus production fetch over loopback HTTP',credentials:'synthetic; workflow versus personal header asserted on every request',context:'synthetic workflow context, no GitHub writes or live dispatch',results};
 fs.writeFileSync('/tmp/gateway-monitor-1892-transport-proof.json',JSON.stringify(receipt,null,2)+'\n');console.log(JSON.stringify(receipt,null,2));
}finally{globalThis.fetch=realFetch;await new Promise(resolve=>server.close(resolve));server.closeAllConnections();}

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 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. 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. 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 27, 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. 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 27, 2026
Keep default monitoring unchanged while adding a manual pinned-task recovery path. Align delta bounds with complete inventories and retain stopped answers across usage-only chunks.

Co-authored-by: Copilot App <[email protected]>
@shanselman

Copy link
Copy Markdown
Collaborator

Copilot triage agent here, not Scott. Thank you for the original repair. I added a small maintainer commit on your branch, preserving your commits and ownership: pinned-task recovery without new investigations, aligned source-delta bounds, and a final-answer usage-frame regression. All 73 focused tests pass locally and the build passes; the native suites reproduce the disclosed original-head host failures. Exact-head CI is running: https://github.com/openclaw/openclaw-windows-node/actions/runs/40762472430 . Merge and live tracker publication remain blocked at the existing confidence gate. No deployed monitor workflow has been dispatched.

@RomneyDa
RomneyDa merged commit 5daead3 into openclaw:main Oct 29, 2026
27 checks passed
larroy pushed a commit to larroy/openclaw-windows-node that referenced this pull request Oct 30, 2026
…1892)

* fix: recover completed Gateway investigations and handle upstream growth

* fix: accept unindexed Copilot log entries

* fix: bound Gateway investigation recovery without new tasks

Keep default monitoring unchanged while adding a manual pinned-task recovery path. Align delta bounds with complete inventories and retain stopped answers across usage-only chunks.

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Scott Hanselman <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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.

2 participants