Skip to content

Commit 38ad228

Browse files
authored
fix: remove erroneous acknowledgeRisk from E2E scenario 05 first compress (#195)
Scenario 05 set acknowledgeRisk=true on the FIRST compress call inside the subagent. This flag is only valid when retrying after a quality gate rejection. On a first attempt, the compress tool correctly rejects it, producing 0 blocks. Root cause: PR #192 copy-pasted from scenario 03 without noticing that scenario 03 nests acknowledgeRisk inside retryOnReject. Fix: remove the flag. Verified passing on both master and PR #184.
1 parent 78232e2 commit 38ad228

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# REQ: Fix E2E scenario 05 — remove erroneous acknowledgeRisk on first compress
2+
3+
## Problem
4+
5+
E2E scenario `05-subagent-compress.json` sets `"acknowledgeRisk": true` on the
6+
**first** compress call inside the subagent. This parameter is only valid when
7+
**retrying** after a quality gate rejection. On a first attempt, the compress
8+
tool correctly rejects it:
9+
10+
```
11+
Parameter "acknowledgeRisk": true was provided, but no quality gate rejection
12+
is pending. This parameter is only valid immediately after a compression was
13+
rejected by the quality gate. Remove it and try again.
14+
```
15+
16+
This causes the child session to produce **0 blocks**, making the test fail on
17+
both master and PR #184.
18+
19+
## Root Cause
20+
21+
PR #192 (`test: E2E scenario for subagent compression`) introduced scenario 05
22+
with `acknowledgeRisk: true` at the top level of the compress step — likely
23+
copy-pasted from scenario 03 without realising scenario 03 nests it inside
24+
`retryOnReject`.
25+
26+
## Fix
27+
28+
Remove `"acknowledgeRisk": true` from the compress step in scenario 05. The
29+
initial compress call should not carry this flag.
30+
31+
## Verification
32+
33+
- Scenario 05 passes on **master** (c149686): `childBlockCount === 1` ✓
34+
- Scenario 05 passes on **#184** (0d679c8 + master merge): `childBlockCount === 1` ✓
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# WORKLOG: Fix E2E scenario 05
2+
3+
## Investigation
4+
5+
User reported that PR #184 (per-session SessionState registry) "didn't pass" —
6+
the E2E scenario 05 (subagent compress) was failing. Deep investigation:
7+
8+
1. **Ran scenario 05 on master** → 6 events (child ran), 1 child state file, 0 blocks. FAIL.
9+
2. **Ran scenario 05 on #184** (without merged #192 infra) → 3 events (child couldn't run — `task` tool not whitelisted). FALSE PASS (childBlockCount assertion skipped).
10+
3. **Merged master into #184** → 6 events, 1 child state file, 0 blocks. FAIL — same as master.
11+
4. **Added ACP debug logging** to `hooks.ts` → confirmed child state IS in registry, `isSubAgent=true`, `assignMessageRefs` working (4 IDs assigned by last transform).
12+
5. **Checked fake LLM log** → compress(m00001..m00003) was sent and a result was received (turn 5 proceeded).
13+
6. **Queried opencode DB** → found the compress tool result: `status: error`, error message: `acknowledgeRisk provided but no quality gate rejection is pending`.
14+
15+
## Root Cause
16+
17+
`"acknowledgeRisk": true` in scenario 05's compress step. This flag is only
18+
valid on retry after quality gate rejection. On first attempt, compress tool
19+
rejects it. The compress never creates a block.
20+
21+
This bug was introduced in PR #192 and affects both master and #184 equally.
22+
PR #184's per-session state is working correctly.
23+
24+
## Fix Applied
25+
26+
Removed `"acknowledgeRisk": true` from `scripts/e2e/scenarios/05-subagent-compress.json`.
27+
28+
## Files Changed
29+
30+
- `scripts/e2e/scenarios/05-subagent-compress.json` — removed `acknowledgeRisk: true` (1 line)
31+
- `devlog/2026-07-25_fix-scenario05-acknowledgeRisk/REQ.md` — this requirement
32+
- `devlog/2026-07-25_fix-scenario05-acknowledgeRisk/WORKLOG.md` — this worklog
33+
34+
## Verification
35+
36+
Both tested with `SKIP_BUILD=1 ./scripts/e2e/run-e2e.sh scripts/e2e/scenarios/05-subagent-compress.json`:
37+
38+
- **master** (c149686): PASS — `childBlockCount === 1` ✓
39+
- **#184** (0d679c8 + master): PASS — `childBlockCount === 1` ✓

‎scripts/e2e/scenarios/05-subagent-compress.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
"respond": "compress",
3737
"topic": "Auth Research",
3838
"summary": "## Authentication Research\n\nResearched authentication methods: passwords biometrics twoFactor certificates. Web apps use session tokens or JWT.\n\n### JWT Implementation\nJWT encodes user claims signs with secret key. Three parts: header payload signature. Client sends via Authorization header. Server verifies signature. verifyToken function at src/auth/jwt.ts line 78. Token signing at src/auth/jwt.ts. Password verification at src/auth/login.ts.\n\n### Security\nrateLimiting against brute force, sessionFixation prevention, httpOnly cookies, csrf protection, https mandatory, sqlInjection prevention. Rate limiter at src/middleware/auth.ts line 30.",
39-
"range": "all",
40-
"acknowledgeRisk": true
39+
"range": "all"
4140
},
4241
{
4342
"respond": "text",

0 commit comments

Comments
 (0)