Extract project favicon route and tighten turn-settled logic

- move `/api/project-favicon` handling into a dedicated server route with coverage for root and source-linked icons
- wire `wsServer` to use the new route helper
- treat any running session as unsettled in `isLatestTurnSettled` to prevent stale latest-turn banners, with test coverage
This commit is contained in:
Julius Marminge committed 2026-02-27 14:58:17 -08:00
1 parent 08ea222735
commit 2eaed39927
5 files changed
+291 -156

No files matched your search

+9
View File
@@ -169,6 +169,15 @@ describe("isLatestTurnSettled", () => {
).toBe(false);
});
it("returns false while any turn is running to avoid stale latest-turn banners", () => {
expect(
isLatestTurnSettled(latestTurn, {
orchestrationStatus: "running",
activeTurnId: TurnId.makeUnsafe("turn-2"),
}),
).toBe(false);
});
it("returns true once the session is no longer running that turn", () => {
expect(
isLatestTurnSettled(latestTurn, {
+2 -3
View File
@@ -83,9 +83,8 @@ export function isLatestTurnSettled(
if (!latestTurn?.startedAt) return false;
if (!latestTurn.completedAt) return false;
if (!session) return true;
return !(
session.orchestrationStatus === "running" && session.activeTurnId === latestTurn.turnId
);
if (session.orchestrationStatus === "running") return false;
return true;
}
export function derivePendingApprovals(