fix: improve plugin system robustness — agent/command resolution, async errors, hook timing, two-phase init (#18280)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
Ryan Skidmore
2026-03-24 12:50:55 -05:00
committed by GitHub
co-authored by Aiden Cline
parent 235a82aea9
commit 814a515a8a
6 changed files with 169 additions and 4 deletions
@@ -117,3 +117,16 @@ describe("session messages endpoint", () => {
})
})
})
describe("session.prompt_async error handling", () => {
test("prompt_async route has error handler for detached prompt call", async () => {
const src = await Bun.file(path.join(import.meta.dir, "../../src/server/routes/session.ts")).text()
const start = src.indexOf('"/:sessionID/prompt_async"')
const end = src.indexOf('"/:sessionID/command"', start)
expect(start).toBeGreaterThan(-1)
expect(end).toBeGreaterThan(start)
const route = src.slice(start, end)
expect(route).toContain(".catch(")
expect(route).toContain("Bus.publish(Session.Event.Error")
})
})