fix(tui): hide initial instruction sync (#36891)

Co-authored-by: Kit Langton <kit.langton@gmail.com>
This commit is contained in:
opencode-agent[bot] 2026-07-14 12:42:09 -04:00 committed by GitHub
commit cd9be63484
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 50 additions and 4 deletions

View file

@ -2385,7 +2385,7 @@ test("renders admitted prompts immediately and tracks them until promoted", asyn
}
})
test("projects live instruction updates with their message ID", async () => {
test("skips initial instruction state and projects later updates with their message ID", async () => {
const events = createEventStream()
const calls = createFetch(undefined, events)
let sync!: ReturnType<typeof useData>
@ -2419,18 +2419,30 @@ test("projects live instruction updates with their message ID", async () => {
created: 0,
type: "session.instructions.updated",
durable: durable("session-1", 0, 2),
metadata: { instructions: { initial: true } },
data: {
sessionID: "session-1",
delta: { "core/date": "0".repeat(64) },
},
})
emitEvent(events, {
id: "evt_instructions_2",
created: 1,
type: "session.instructions.updated",
durable: durable("session-1", 1, 2),
data: {
sessionID: "session-1",
delta: { "core/date": "1".repeat(64) },
},
})
await wait(() => sync.session.message.list("session-1")?.length === 1)
await wait(() => sync.session.message.list("session-1")?.some((message) => message.time.created === 1))
expect(sync.session.message.list("session-1")).toHaveLength(1)
expect(sync.session.message.list("session-1")?.[0]).toMatchObject({
id: SessionMessage.ID.fromEvent(EventV2.ID.make("evt_instructions_1")),
id: SessionMessage.ID.fromEvent(EventV2.ID.make("evt_instructions_2")),
type: "system",
text: "Instructions updated: core/date",
time: { created: 0 },
time: { created: 1 },
})
} finally {
app.renderer.destroy()