7 Commits

Author SHA1 Message Date
Evgeny Shurakov a2d18131a8 feat(kilo-sessions): send git remote URL and branch to ingest
Add gitUrl and gitBranch fields to kilo_meta so shared sessions
include repository context. Resolves the best remote (origin > single
available > upstream) and fetches the URL with a 10s in-flight cache.
2026-02-18 22:38:46 +01:00
Igor Šćekić cb84cb0439 fix(session): align close reason type and publish turn close reliably
Unify ingest queue and session close reasons via `Session.CloseReason` and
ensure `TurnOpen`/`TurnClose` publishing is awaited; mark close reason as
`error` on unexpected exceptions and handle abort-induced stops correctly.

Add ingest queue tests for stable-key coalescing of session open/close and for
including `?v=1` on flush requests.
2026-02-09 13:58:09 +01:00
Igor Šćekić b04e8e877c fix(kilo-sessions): handle sync throws in inflight cache
Wrap callback execution in a promise microtask so synchronous errors flow
through the existing `.catch()` and the in-flight entry is reliably cleaned
up. Update tests to await the microtask before asserting call count.
2026-02-02 15:41:37 +01:00
Igor Šćekić 18934825aa test(kilo-sessions): update in-flight cache test for undefined values 2026-02-02 14:49:07 +01:00
Igor Šćekić e815689023 fix(kilo-sessions): await in-flight refresh to avoid stale reads
Always return the in-flight promise when a refresh is running so callers
don’t receive an expired cached value. Preserve the original timestamp
until refresh succeeds and only update it on successful recompute to
avoid masking failed refreshes.
2026-02-02 13:37:08 +01:00
Igor Šćekić 9a4fb8c786 test(kilo-sessions): add in-flight cache behavior tests 2026-02-02 13:24:42 +01:00
Igor Šćekić 960bc15133 test(kilo-sessions): move ingest queue test suite 2026-02-02 13:24:02 +01:00