feat(browser): prefer Chrome default + add Brave/Edge fallbacks

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-16 03:24:53 +00:00
parent a0d2a7232e
commit a5d8f89b53
16 changed files with 172 additions and 67 deletions

View File

@@ -54,7 +54,9 @@ describe("subagent announce formatting", () => {
});
expect(agentSpy).toHaveBeenCalled();
const call = agentSpy.mock.calls[0]?.[0] as { params?: { message?: string; sessionKey?: string } };
const call = agentSpy.mock.calls[0]?.[0] as {
params?: { message?: string; sessionKey?: string };
};
const msg = call?.params?.message as string;
expect(call?.params?.sessionKey).toBe("agent:main:main");
expect(msg).toContain("background task");

View File

@@ -119,7 +119,8 @@ describe("subagent registry persistence", () => {
// announce should NOT be called since cleanupHandled was true
const calls = announceSpy.mock.calls.map((call) => call[0]);
const match = calls.find(
(params) => (params as { childSessionKey?: string }).childSessionKey === "agent:main:subagent:two",
(params) =>
(params as { childSessionKey?: string }).childSessionKey === "agent:main:subagent:two",
);
expect(match).toBeFalsy();
});

View File

@@ -38,9 +38,7 @@ export function loadSubagentRegistryFromDisk(): Map<string, SubagentRunRecord> {
const announceCompletedAt =
typeof typed.announceCompletedAt === "number" ? typed.announceCompletedAt : undefined;
const cleanupCompletedAt =
typeof typed.cleanupCompletedAt === "number"
? typed.cleanupCompletedAt
: announceCompletedAt;
typeof typed.cleanupCompletedAt === "number" ? typed.cleanupCompletedAt : announceCompletedAt;
const cleanupHandled =
typeof typed.cleanupHandled === "boolean"
? typed.cleanupHandled

View File

@@ -214,11 +214,7 @@ function ensureListener() {
});
}
function finalizeSubagentCleanup(
runId: string,
cleanup: "delete" | "keep",
didAnnounce: boolean,
) {
function finalizeSubagentCleanup(runId: string, cleanup: "delete" | "keep", didAnnounce: boolean) {
const entry = subagentRuns.get(runId);
if (!entry) return;
if (cleanup === "delete") {

View File

@@ -442,7 +442,8 @@ export function buildAgentSystemPrompt(params: {
if (extraSystemPrompt) {
// Use "Subagent Context" header for minimal mode (subagents), otherwise "Group Chat Context"
const contextHeader = promptMode === "minimal" ? "## Subagent Context" : "## Group Chat Context";
const contextHeader =
promptMode === "minimal" ? "## Subagent Context" : "## Group Chat Context";
lines.push(contextHeader, extraSystemPrompt, "");
}
if (params.reactionGuidance) {