Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,10 @@ An active recorder leaves a .recording marker; partial/crashed recordings with t
its trace is written. The proxy forwards live requests and records their stream
contents; header redaction stays on by default, but body contents may still be
sensitive. Use only with trusted local clients and upstreams.

On Linux, reading a session requires `/proc/self/fd` to be mounted and readable.
The check runs when opening each trace, not at server startup. Without procfs,
the recording proxy and panel still start, but recorded sessions show as
unavailable and session replay requests return HTTP400. The check fails closed
to keep opened file descriptors inside the session root. Standalone record/replay
CLI use remains available in containers without procfs.
2 changes: 1 addition & 1 deletion test/serve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test('active POST recording is unavailable and stopping cancels its upstream con
await h.close();await Promise.race([closed,new Promise((_,reject)=>setTimeout(()=>reject(Error('upstream leaked')),1000))]);await response.body?.cancel().catch(()=>{});
}finally{await h.close();upstream.closeAllConnections();await new Promise<void>(r=>upstream.close(()=>r()));await fs.rm(root,{recursive:true,force:true});}
});
test('recording marker prevents partial legacy session replay',async()=>{const f=await fixture();const h=await startServe({target:f.target,outDir:f.root,port:0,panelPort:0});try{await fs.mkdir(path.join(f.root,'partial'));await fs.writeFile(path.join(f.root,'partial','.recording'),'active');await fs.writeFile(path.join(f.root,'partial','events.jsonl'),'{}');expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(400);}finally{await h.close();await f.done();}});
test('recording marker prevents partial legacy session replay',async()=>{const f=await fixture();const h=await startServe({target:f.target,outDir:f.root,port:0,panelPort:0});try{await fs.mkdir(path.join(f.root,'partial'));await fs.writeFile(path.join(f.root,'partial','.recording'),'active');await fs.writeFile(path.join(f.root,'partial','events.jsonl'),JSON.stringify({v:1,kind:'meta',session:'partial',adapter:'sse',framing:'sse',protocol:'generic',startedAt:new Date(0).toISOString()})+'\n');expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(400);await fs.unlink(path.join(f.root,'partial','.recording'));expect((await fetch(h.url+'sessions/partial/stream')).status).toBe(200);}finally{await h.close();await f.done();}});


test('SIGTERM during startup releases an acquired root lock',async()=>{
Expand Down