fix(tui): hide initial instruction sync (#36891)
Co-authored-by: Kit Langton <kit.langton@gmail.com>
This commit is contained in:
parent
40fedf086e
commit
cd9be63484
4 changed files with 50 additions and 4 deletions
|
|
@ -30,6 +30,8 @@ export const prepare = Effect.fn("InstructionState.prepare")(function* (
|
|||
SessionEvent.InstructionsUpdated,
|
||||
{ sessionID, delta: admission.delta },
|
||||
{
|
||||
// Initial sync establishes the baseline; unlike later deltas it is not chronological history.
|
||||
...(!stored ? { metadata: { instructions: { initial: true } } } : {}),
|
||||
commit: () => insertBlobs(db, admission.blobs),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -943,6 +943,30 @@ describe("SessionRunnerLLM", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
it.effect("marks the initial instruction sync as baseline metadata", () =>
|
||||
Effect.gen(function* () {
|
||||
const session = yield* setup
|
||||
const events = yield* EventV2.Service
|
||||
const instructionEvents: EventV2.Payload[] = []
|
||||
const unsubscribe = yield* events.listen((event) =>
|
||||
Effect.sync(() => {
|
||||
if (event.type === "session.instructions.updated") instructionEvents.push(event)
|
||||
}),
|
||||
)
|
||||
yield* admit(session, "First")
|
||||
|
||||
yield* session.resume(sessionID)
|
||||
systemBaseline = "Changed context"
|
||||
yield* admit(session, "Second")
|
||||
yield* session.resume(sessionID)
|
||||
yield* unsubscribe
|
||||
|
||||
expect(instructionEvents).toHaveLength(2)
|
||||
expect(instructionEvents[0]?.metadata).toEqual({ instructions: { initial: true } })
|
||||
expect(instructionEvents[1]?.metadata).toBeUndefined()
|
||||
}),
|
||||
)
|
||||
|
||||
it.effect("retries the first request after system context becomes available", () =>
|
||||
Effect.gen(function* () {
|
||||
const session = yield* setup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue