Repository navigation
Description
Describe the bug
ChatSessionsTest drives a private await(sessions, ready) helper that polls a session snapshot until a predicate holds, and that helper defaults to a 15 s budget. #2751 (20dc107e4) widened exactly one of its call sites to 60 s; the other 13 still use the 15 s default, so the same kind of wait gets a 60 s budget in one test method and 15 s in its siblings.
On the build (windows-latest) lane the 15 s budget is not always enough, and the class keeps failing intermittently.
Environment
- AgentScope-Java Version: 2.1.0-SNAPSHOT
- Module:
agentscope-examples/agents/agentscope-chat - Lane:
build (windows-latest) - JDK 17
Where the numbers come from
ChatSessionsTest.java:
private ChatHistory.Snapshot await(ChatSessions sessions, Predicate<ChatHistory.Snapshot> ready)
throws Exception {
return await(sessions, ready, Duration.ofSeconds(15)); // <- the default every caller inherits
}Parsing every await(...) call site in the class and checking the argument list for an explicit Duration:
- 14 call sites use this helper.
- 1 of them (line 125, in
interruptedTaskKeepsQueuedWorkUntilExplicitContinuation) passesDuration.ofSeconds(60)— added by fix(tools): report tool success/failure via ToolResultBlock state #2751. - 13 still fall through to the 15 s default.
(Line 90's session.await(task).block(Duration.ofSeconds(15)) is a different API on the session object, not this helper, and line 271 is the helper body itself; neither is counted above.)
Evidence
Failure on a branch that already contains current main. Head 1c51113f7 (base 65a35d40a), run 38200839074, job 114653674945, 2026-10-12T04:13Z:
[ERROR] ChatSessionsTest.queuedTasksAreDistinctAndSteeringStaysInCurrentExecution -- Time elapsed: 23.56 s <<< FAILURE!
java.lang.AssertionError: Timed out: [Turn[turnId=7d47e214-0352-3f5d-a3e7-5880e7d8c12e, runId=81ff43af9d78460a8be15facdd6bc23b, status=running]]
at io.agentscope.examples.chat.ChatSessionsTest.await(ChatSessionsTest.java:289)
at io.agentscope.examples.chat.ChatSessionsTest.await(ChatSessionsTest.java:271)
at io.agentscope.examples.chat.ChatSessionsTest.queuedTasksAreDistinctAndSteeringStaysInCurrentExecution(ChatSessionsTest.java:58)
await:271 in that stack is the 15 s default overload — the call site at line 58 has no explicit budget.
The useful part is the same run's neighbour. interruptedTaskKeepsQueuedWorkUntilExplicitContinuation ran in the same JVM, on the same machine, immediately before, and took nearly as long — but passed, because #2751 gave it 60 s:
| method | elapsed this run | budget | result |
|---|---|---|---|
interruptedTaskKeepsQueuedWorkUntilExplicitContinuation |
21.04 s | 60 s | passed |
queuedTasksAreDistinctAndSteeringStaysInCurrentExecution |
23.56 s | 15 s | failed |
Also reproducible on main. Run 37902215993 (ef0b9b8fe, 2026-10-09T07:59Z) failed two methods of this class in one go — Tests run: 10, Failures: 2:
[ERROR] ChatSessionsTest.interruptedTaskKeepsQueuedWorkUntilExplicitContinuation
[ERROR] ChatSessionsTest.queuedTasksAreDistinctAndSteeringStaysInCurrentExecution
Both were on the 15 s default at that commit; #2751 then widened only the first.
What I am and am not claiming
- I am not claiming the timeouts are the whole story. 21-24 s for these flows may itself be worth investigating, and a 60 s budget would hide that rather than answer it. What the evidence supports is narrower: the class's timing budget is inconsistent — two neighbouring methods doing comparable work get 60 s and 15 s.
- I am not opening a PR for this.
ChatSessionsTest.javacurrently has two open PRs touching it (#3375, #2996), so whoever lands those is best placed to decide the budget, and I did not want to add a third. - The plain fix consistent with the existing precedent would be to give the 13 remaining call sites the same 60 s that fix(tools): report tool success/failure via ToolResultBlock state #2751 gave the one at line 125 — but that is a decision for the maintainers, not something I want to bundle into a PR that would collide.
Activity
wahllllll commentedon Oct 14, 2026
Independent reproduction on an unrelated PR, to add to the evidence above.
2026-10-14, PR #3520 (E2B sandbox gateway URL, author @wg1026688210 — nothing to do with
ChatSessionsTest),build (windows-latest), run 38501237403 job115648446030, head196019876:Same method, same shape as the original report: ~23 s of waiting against the 15 s default. Two takeaways:
This is still just a report — the file is occupied by #3375 / #2996, so no PR is attached here.