refactor(task-toast): improve task toast manager types and logic

Add new toast types and improve state management for background task notifications. Update tests to cover new scenarios.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
justsisyphus
2026-01-22 22:46:36 +09:00
parent aa2b052d28
commit 72098213ee
3 changed files with 21 additions and 13 deletions
@@ -160,7 +160,7 @@ describe("TaskToastManager", () => {
// #then - toast should NOT show warning - category default is expected
expect(mockClient.tui.showToast).toHaveBeenCalled()
const call = mockClient.tui.showToast.mock.calls[0][0]
expect(call.body.message).not.toContain("⚠️")
expect(call.body.message).not.toContain("[FALLBACK]")
expect(call.body.message).not.toContain("(category default)")
})
@@ -180,7 +180,7 @@ describe("TaskToastManager", () => {
// #then - toast should show fallback warning
expect(mockClient.tui.showToast).toHaveBeenCalled()
const call = mockClient.tui.showToast.mock.calls[0][0]
expect(call.body.message).toContain("⚠️")
expect(call.body.message).toContain("[FALLBACK]")
expect(call.body.message).toContain("anthropic/claude-sonnet-4-5")
expect(call.body.message).toContain("(system default fallback)")
})
@@ -201,7 +201,7 @@ describe("TaskToastManager", () => {
// #then - toast should show fallback warning
expect(mockClient.tui.showToast).toHaveBeenCalled()
const call = mockClient.tui.showToast.mock.calls[0][0]
expect(call.body.message).toContain("⚠️")
expect(call.body.message).toContain("[FALLBACK]")
expect(call.body.message).toContain("cliproxy/claude-opus-4-5")
expect(call.body.message).toContain("(inherited from parent)")
})
@@ -222,7 +222,7 @@ describe("TaskToastManager", () => {
// #then - toast should NOT show model warning
expect(mockClient.tui.showToast).toHaveBeenCalled()
const call = mockClient.tui.showToast.mock.calls[0][0]
expect(call.body.message).not.toContain("⚠️ Model:")
expect(call.body.message).not.toContain("[FALLBACK] Model:")
expect(call.body.message).not.toContain("(inherited)")
expect(call.body.message).not.toContain("(category default)")
expect(call.body.message).not.toContain("(system default)")
@@ -243,7 +243,7 @@ describe("TaskToastManager", () => {
// #then - toast should NOT show model warning
expect(mockClient.tui.showToast).toHaveBeenCalled()
const call = mockClient.tui.showToast.mock.calls[0][0]
expect(call.body.message).not.toContain("⚠️ Model:")
expect(call.body.message).not.toContain("[FALLBACK] Model:")
})
})
})