Skip to content
Closed
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
2 changes: 2 additions & 0 deletions packages/opencode/test/cli/run/nested-quota-continued.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe("continued nested session quota handling (#555)", () => {
env,
timeoutMs: 20_000,
})
console.error("probe child output:", JSON.stringify({ exitCode: first.exitCode, stdout: first.stdout, stderr: first.stderr }))
opencode.expectExit(first, 0)

const grandchildStarted = gate()
Expand Down Expand Up @@ -178,6 +179,7 @@ describe("continued nested session quota handling (#555)", () => {
// A parent can handle a child failure and finish its own turn. The CLI's
// declared-failure exit policy is separate from whether the quota error
// reaches the parent, so assert the delivered error and bounded exit.
console.error("probe child output:", JSON.stringify({ exitCode: result.exitCode, stdout: result.stdout, stderr: result.stderr }))
expect(result.durationMs).toBeLessThan(25_000)
expect(result.stdout + result.stderr).toContain("LOCAL_ROOT_QUOTA_SURFACED")
const inputs = (yield* llm.inputs) as Body[]
Expand Down
2 changes: 2 additions & 0 deletions packages/opencode/test/cli/run/run-retry-wait.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ describe("headless run provider retry delay (#555)", () => {
}
yield* llm.push(reply().text("init").tool("finish", { reason: "success", result: "ok" }).stop())
const first = yield* opencode.run("Research the initial session report", { model: "opencode/local-quota-test", env, timeoutMs: 20_000 })
console.error("probe child output:", JSON.stringify({ exitCode: first.exitCode, stdout: first.stdout, stderr: first.stderr }))
expect(first.exitCode).toBe(0)
const opened = (body: Body, text: string) => body.messages?.at(-1)?.role === "user" && lastText(body).includes(text)
const followed = (body: Body, text: string) => body.messages?.at(-1)?.role === "tool" && JSON.stringify(body).includes(text)
Expand All @@ -137,6 +138,7 @@ describe("headless run provider retry delay (#555)", () => {
timeoutMs: 50_000, extraArgs: ["--continue", "--dangerously-skip-permissions"], model: "opencode/local-quota-test", env, clockScale: 10,
})
// Retry policy unchanged: the child waits, retries and the run finishes.
console.error("probe child output:", JSON.stringify({ exitCode: result.exitCode, stdout: result.stdout, stderr: result.stderr }))
expect(result.exitCode).toBe(0)
expect(result.stdout).toContain("ROOT_FINAL")
expect(result.stderr).toMatch(/subagent waiting about \d+s before retrying \(attempt 1\): free usage limit reached/)
Expand Down
Loading