From 4bded98a20b2c78c2989ac6aa464067a9f1737f5 Mon Sep 17 00:00:00 2001 From: developjik <67889389+developjik@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:25:10 +0900 Subject: [PATCH 1/3] Refactor test for recording marker and session replay Updated test to handle JSON structure in events.jsonl and verify session status correctly. --- test/serve.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/serve.test.ts b/test/serve.test.ts index 717fc69..806098e 100644 --- a/test/serve.test.ts +++ b/test/serve.test.ts @@ -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(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()=>{ From a747e77399698a3f0cea9f23ab60a936b2285949 Mon Sep 17 00:00:00 2001 From: developjik <67889389+developjik@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:25:18 +0900 Subject: [PATCH 2/3] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 0c03f14..284a4a2 100644 --- a/README.md +++ b/README.md @@ -375,3 +375,8 @@ 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, the session panel requires `/proc/self/fd` to be mounted and readable. +It verifies the opened file descriptor stays inside the session root and fails +closed if that check is unavailable. A container without procfs can still use +the existing standalone record/replay CLI, but cannot use the serve session panel. From 3f7771a921f3f640c40ed5aa40b7746d839708ba Mon Sep 17 00:00:00 2001 From: developjik <67889389+developjik@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:30:27 +0900 Subject: [PATCH 3/3] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 284a4a2..c45e399 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,9 @@ 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, the session panel requires `/proc/self/fd` to be mounted and readable. -It verifies the opened file descriptor stays inside the session root and fails -closed if that check is unavailable. A container without procfs can still use -the existing standalone record/replay CLI, but cannot use the serve session panel. +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.