test(cli): unflake permission.create after isolated fixtures - #13113
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 278cd7ee2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files, incremental)
The PR was rewritten since the last review: the previous production-side readiness fix ( Previous Review Summaries (2 snapshots, latest commit bf75e30)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit bf75e30)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files, incremental)
The previous SUGGESTION (unbounded wait if the Previous review (commit 278cd7e)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
The core fix is sound: Reviewed by kimi-k3 · Input: 160.7K · Output: 6.7K · Cached: 448.5K Review guidance: REVIEW.md from base branch |
bf75e30 to
73de3cf
Compare
0932376 to
2177b47
Compare
After #13091 isolated this scenario on a fresh project, permission.create can race AgentPlugin boot and get deny-all. Wait for the default build agent over GET /api/agent before asserting ask.
2177b47 to
df8f689
Compare
Main landed the same httpapi design (git-opt-in fixtures, --shard flag) and the same permission.create readiness wait. Resolution adopts main's implementations and keeps this branch's unique work on top: the --shards child-process orchestrator (adapted to main's zero-based shard indexing), scenario retry with backoff gated on state-reset, project.update isolation, and exerciser env stripping. Removed the superseded agentsReady/probe machinery and this branch's duplicate round-robin filter (double-sharding silently dropped scenarios). Validated: coverage, auth, and 4-shard effect passes all green (315 checks, 0 failures).
…13113) After Kilo-Org#13091 isolated this scenario on a fresh project, permission.create can race AgentPlugin boot and get deny-all. Wait for the default build agent over GET /api/agent before asserting ask.
Issue
No existing issue. This is a test-only flake that started after #13091 isolated
v2.session.permission.createon a fresh project.Context
#13091 made this scenario cheap enough to run before the default
buildagent finishes loading.PermissionV2.configuredthen falls back to deny-all, so the assertioneffect === "ask"flakes.Wait for that agent over
GET /api/agentbefore asserting. The failure message now includes the observed effect so a recurrence is diagnosable. No production change.Implementation
sessionAfterDefaultAgentpollsGET /api/agentuntilAgentV2.defaultIDappears, then the scenario posts the permission request. That list and the.envask rule are written in the sameAgentPlugintransform, so the gate is causally correct for this assertion.The probe uses the same
x-kilo-directorythe later POST uses. A workspace/worktree session would boot a differentAgentV2and this wait would not cover it. The wait stays on this scenario rather than the shared runner so the other 300+ scenarios do not pay an extra HTTP poll.Screenshots / Video
N/A — test-only, no UI change.
How to Test
Manual/local verification
bun run typecheckinpackages/opencode/— passbun run script/check-opencode-annotations.ts --worktree— passbun run script/httpapi-exercise.ts --mode effect --include v2.session.permission.create --fail-on-skip—PASSReviewer test steps
packages/opencode/, runbun run script/httpapi-exercise.ts --mode effect --include v2.session.permission.createeffect === "ask"Blocked checks and substitute verification
bun run test:httpapiwas not re-run after the assertion message change; the isolatedv2.session.permission.createscenario was.Checklist
Get in Touch