You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fix] Flaky mocked e2e subtasks test when parent resume is served the child fixture (#1002)
* test(e2e-mock): fix subtasks fixture collision between child and parent-resume fixtures (#1001)
The fast-child and SUBTASK_CHILD fixtures matched a bare marker that the
parent prompt embeds verbatim, so parent-resume turns could be served the
child fixture (mirrors #561, which fixed the same class for cross-profile
fixtures only). Parent-resume fixtures also guarded on the literal new_task
tool-call id, which validateAndFixToolResultIds can rewrite on resume.
- Add parent-marker exclusion (with aimock's last-user-message scoping) to
the fast-child and SUBTASK_CHILD fixtures
- Guard parent-resume fixtures on the injected subtask result content
instead of the fragile tool-call id
* test(e2e-mock): address PR review — injection-guard all parent fixtures, link fixture format contract
- Regular parent turn-1 fixture: exclude resume turns via
SUBTASK_RESULT_INJECTION instead of relying on registration order
(sequenceIndex is not viable here — the fixture is shared by 4 tests)
- Fast and api-hang parent-resume guards: match SUBTASK_RESULT_INJECTION
instead of the child result text, which is embedded verbatim in the
parent prompts and could match the parent's initial request on retry
- Add unit-test assertion pinning reopenParentFromDelegation's injected
tool_result format to the 'completed.\n\nResult:' contract the e2e
fixtures match on
- lastUserMessageContains: mirror aimock's getTextContent (text parts
only) instead of JSON.stringify for non-string content
- Extract SUBTASK_FAST_CHILD_RESULT constant
- Replace tautological find()/assert pairs in the api-hang test
- Move the no-parent-resume assertion in the cancellation test behind
the async settle gates and also assert no completion_result
---------
Co-authored-by: Roomote <roomote@roomote.dev>
constSUBTASK_CHILD_PROMPT=`${SUBTASK_CHILD_MARKER}: Ask the user exactly this follow-up question: What is the square root of 81? After the user answers, complete with only the answer.`
19
19
exportconstSUBTASK_PARENT_PROMPT=`${SUBTASK_PARENT_MARKER}: Use the new_task tool exactly once. Create an ask-mode subtask with this exact message: "${SUBTASK_CHILD_PROMPT}" Do not answer directly.`
20
20
exportconstSUBTASK_CHILD_FOLLOWUP_ANSWER="9"
21
-
constSUBTASK_FAST_CHILD_PROMPT=`${SUBTASK_FAST_CHILD_MARKER}: Complete immediately with the exact result "Fast child completed".`
constSUBTASK_FAST_CHILD_PROMPT=`${SUBTASK_FAST_CHILD_MARKER}: Complete immediately with the exact result "${SUBTASK_FAST_CHILD_RESULT}".`
22
23
exportconstSUBTASK_FAST_PARENT_PROMPT=`${SUBTASK_FAST_PARENT_MARKER}: Use the new_task tool exactly once. Create an ask-mode subtask with this exact message: "${SUBTASK_FAST_CHILD_PROMPT}" Do not answer directly.`
23
24
24
25
constSUBTASK_INTERRUPT_CHILD_PROMPT=`${SUBTASK_INTERRUPT_CHILD_MARKER}: Ask the user exactly this follow-up question: What is the square root of 81? After the user answers, complete with only the answer.`
0 commit comments