fix: complete scheduled runs and harden background task status

- Route directory-less OpenCode session events (session.execution.*,
  session.usage.updated) to backend listeners by remembering each
  session's directory in the SSE aggregator, so scheduled runs finish
  and failure push notifications fire; browser delivery is unchanged.
- Resolve background shell status from the transcript completion notice
  when OpenCode no longer lists the shell, keep the first terminal
  status so a kill is not reported as completed, and share one status
  icon and colour mapping between the transcript and background bar.
- Reconcile child sessions only while unknown or running, trigger it
  from the EventProvider alone, refresh children that drop to unknown
  after a poll, and forget deleted sessions.
- Fetch the model list and default concurrently while waiting for the
  schedule model, share configured-model selection, and consolidate
  schedule startup cancellation cleanup.
- Reduce background work re-renders, prune shell exit records, remove
  dead exports, and document background work in the chat guide.
This commit is contained in:
Chris Scott committed 2026-09-28 22:47:13 +00:00
1 parent a75d86c339
commit 409f2c4999
31 files changed
+1197 -279

No files matched your search

@@ -225,6 +225,24 @@ describe('resolveOpenCodeModel', () => {
expect(listCalls).toBe(3)
})
it('resolves an object configured model and preserves its variant', async () => {
const client = createClientStub({
models: [model('openai', 'gpt-5')],
configEntries: [
{ type: 'document', info: { model: { providerID: 'openai', model: 'gpt-5', variant: 'high' } } } as ConfigEntry,
],
})
const result = await resolveOpenCodeModel(client, DIR)
expect(result).toEqual({
providerID: 'openai',
id: 'gpt-5',
variant: 'high',
model: 'openai/gpt-5#high',
})
})
it('does not resolve a same-provider fallback before the target model loads', async () => {
const client = createClientStub({
models: [model('openai', 'gpt-4')],