fix(acp): speed up acp-next warm switches (#29713)

This commit is contained in:
Shoubhit Dash
2026-05-28 15:10:17 +05:30
committed by GitHub
parent 2449b50585
commit 9031ce7b51
3 changed files with 175 additions and 25 deletions

View File

@@ -42,7 +42,7 @@ describe("opencode acp-next verifier timing diagnostics", () => {
)
cliIt.live(
"warm new session timing diagnostic stays below generous threshold",
"warm new session stays below verifier threshold",
({ home, llm, opencode }) =>
Effect.gen(function* () {
const acp = yield* createAcpNextClient(
@@ -57,15 +57,13 @@ describe("opencode acp-next verifier timing diagnostics", () => {
const durationMs = Math.round(performance.now() - started)
expect(session.sessionId).toBeTruthy()
// TODO: replace this diagnostic assertion with finalFastPathThresholdMs.
expect(durationMs).toBeLessThan(diagnosticFastPathThresholdMs)
expect(finalFastPathThresholdMs).toBe(100)
expect(durationMs).toBeLessThan(finalFastPathThresholdMs)
}),
60_000,
)
cliIt.live(
"model switch timing diagnostic updates currentValue below generous threshold",
"model switch updates currentValue below verifier threshold",
({ home, llm, opencode }) =>
Effect.gen(function* () {
const acp = yield* createAcpNextClient(
@@ -89,14 +87,13 @@ describe("opencode acp-next verifier timing diagnostics", () => {
const durationMs = Math.round(performance.now() - started)
expect(expectSelectOption(updated.configOptions, "model").currentValue).toBe(nextModel)
// TODO: replace this diagnostic assertion with finalFastPathThresholdMs.
expect(durationMs).toBeLessThan(diagnosticFastPathThresholdMs)
expect(durationMs).toBeLessThan(finalFastPathThresholdMs)
}),
60_000,
)
cliIt.live(
"effort switch timing diagnostic updates currentValue below generous threshold",
"effort switch updates currentValue below verifier threshold",
({ home, llm, opencode }) =>
Effect.gen(function* () {
const acp = yield* createAcpNextClient(
@@ -118,8 +115,7 @@ describe("opencode acp-next verifier timing diagnostics", () => {
const durationMs = Math.round(performance.now() - started)
expect(expectSelectOption(updated.configOptions, "effort").currentValue).toBe(nextEffort)
// TODO: replace this diagnostic assertion with finalFastPathThresholdMs.
expect(durationMs).toBeLessThan(diagnosticFastPathThresholdMs)
expect(durationMs).toBeLessThan(finalFastPathThresholdMs)
}),
60_000,
)