feat(kitchen-sink): add mock agentic lifecycle loop#4914
feat(kitchen-sink): add mock agentic lifecycle loop#4914NathanFlurry wants to merge 1 commit intomock-agentic-loop/kitchen-sink-examplefrom
Conversation
PR Review: feat(kitchen-sink): add mock agentic lifecycle loopOverviewThis PR substantially expands the mock agentic lifecycle test harness in Issues1. Timer leak in The 2. Platform-specific process management
3. Hard-coded 2-second sleeps in cleanup helpers
4. This 15-second delay in 5. IIFE for final history validation is hard to read The inline self-invoking async function around line 1121 should be extracted as a named function (e.g. 6. Double cast Bypasses the type system entirely. If actor action signatures change there is no compile-time check. Define the interface against the typed handle's action surface. 7. Unbounded backlog in The 8. Repeated reconnect-time check
Minor
SummaryArchitecture is sound; the probe loop + sleep-close observation pattern is a solid approach for validating lifecycle behavior under reconnect. Main blocking issue: timer leak in |
2e3e511 to
2261075
Compare
58a8948 to
d4ad418
Compare
PR Review: feat(kitchen-sink) — add mock agentic lifecycle loopOverviewThis PR substantially expands the kitchen-sink mock agentic loop test harness with:
IssuesHard: Logic / Correctness
There are two separate places that check IIFE in validateHistory(await (async () => {
const finalSession = new RawSession(...);
...
finalSession.close(); // not called if an exception is thrown first
return history;
})(), expectedRequests);Extract this into a named async function (e.g. Unbounded Messages pushed to Medium: Platform AssumptionsLinux-only: The function iterates over
Medium: Style / Conventions
The function appears verbatim in both Error event in const onError = () => {
cleanup();
reject(new Error("websocket error"));
};The Probe const timeout = (phase: string) =>
new Promise<never>((_resolve, reject) => {
setTimeout(() => reject(...), PROBE_TIMEOUT_MS);
});The
stringValue(request.requestId, "requestId");
positiveInteger(request.seconds, "seconds");These are called only for their throw-on-invalid side effect. A comment or renaming to Low: Minor Notes
SummaryThe core design is solid: the probe loop and sleep-close observation are good additions that catch real liveness regressions. The main asks before merging are (1) unifying the two |
2261075 to
f116193
Compare
d4ad418 to
2483b16
Compare
2483b16 to
39bcaec
Compare
f116193 to
0290633
Compare
39bcaec to
fb5c7d4
Compare
|
Landed in main via stack-merge fast-forward push. Commits are in main; closing to match. |

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: