Repository navigation
Conversation
|
🦞👀 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: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes: No label 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 HistoryReviewed October 27, 2026, 3:13 PM ET / 19:13 UTC (Revision 3). |
Current-head publication boundary proofHead:
Allowed and lost-response cases include repeated This transport proof supplements, not replaces, live collection (10,119 files) and real existing-task retrieval (1,273-character 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 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();} |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
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]>
|
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. |
…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]>
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
Scope
winnodeRequired 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.40762472430, head43b308a2696722927fd8678c89f6989e581cdb97: completed success; CI Gate passed. Merge, deployed monitor dispatch and tracker result publication remain blocked.Real Behavior Proof
43b308a2696722927fd8678c89f6989e581cdb97.sourceInventory,sourceChanges,validateReport,readTaskResult,publishandhandoff; the recovery workflow's actual JavaScript step is also evaluated with controlled client inputs.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.Security Impact
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
main,report_only=false,recovery_only=true, and the then-recordedrecovery_task_id; inspect the first run before dispatching the unchanged second run. This is a proposal, not permission to execute it.Review Conversations