Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/coding-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

- Fixed `startup.quiet` leaving MCP and LSP startup status events visible during launch ([#2639](https://github.com/can1357/oh-my-pi/issues/2639)).

## [15.13.3] - 2026-06-15

### Added
Expand Down
2 changes: 2 additions & 0 deletions packages/coding-agent/src/modes/interactive-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ export class InteractiveMode implements InteractiveModeContext {
if (eventBus) {
this.#eventBusUnsubscribers.push(
eventBus.on(LSP_STARTUP_EVENT_CHANNEL, data => {
if (this.settings.get("startup.quiet")) return;
this.#handleLspStartupEvent(data as LspStartupEvent);
}),
);
Expand All @@ -551,6 +552,7 @@ export class InteractiveMode implements InteractiveModeContext {
logger.warn("Ignoring malformed mcp:connecting event", { data });
return;
}
if (this.settings.get("startup.quiet")) return;
this.showStatus(formatMCPConnectingMessage(data.serverNames));
}),
);
Expand Down
7 changes: 4 additions & 3 deletions packages/coding-agent/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1608,8 +1608,9 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
let startDeferredMCPDiscovery:
| ((liveSession: AgentSession, activation: DeferredMCPActivation) => void)
| undefined;
const startupQuiet = settings.get("startup.quiet");
const onMCPConnecting = (serverNames: string[]) => {
if (!options.hasUI || serverNames.length === 0) return;
if (!options.hasUI || startupQuiet || serverNames.length === 0) return;
eventBus.emit(MCP_CONNECTING_EVENT_CHANNEL, { serverNames } satisfies McpConnectingEvent);
};
const mcpDiscoverOptions = {
Expand Down Expand Up @@ -2696,7 +2697,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
type: "completed",
servers: result.servers,
};
eventBus.emit(LSP_STARTUP_EVENT_CHANNEL, event);
if (!startupQuiet) eventBus.emit(LSP_STARTUP_EVENT_CHANNEL, event);
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
logger.warn("LSP server warmup failed", { cwd, error: errorMessage });
Expand All @@ -2708,7 +2709,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
type: "failed",
error: errorMessage,
};
eventBus.emit(LSP_STARTUP_EVENT_CHANNEL, event);
if (!startupQuiet) eventBus.emit(LSP_STARTUP_EVENT_CHANNEL, event);
}
})();
}
Expand Down
12 changes: 12 additions & 0 deletions packages/coding-agent/test/interactive-mode-lsp-startup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,16 @@ describe("InteractiveMode LSP startup welcome banner", () => {
expect(findServerLine()).toContain(theme.status.enabled);
expect(findServerLine()).not.toContain(theme.status.pending);
});

it("does not render LSP startup warnings when startup.quiet is enabled", () => {
session.settings.set("startup.quiet", true);
const showWarningSpy = vi.spyOn(mode, "showWarning").mockImplementation(() => {});

eventBus.emit(LSP_STARTUP_EVENT_CHANNEL, {
type: "failed",
error: "rust-analyzer timed out",
} satisfies LspStartupEvent);

expect(showWarningSpy).not.toHaveBeenCalled();
});
});
11 changes: 11 additions & 0 deletions packages/coding-agent/test/interactive-mode-mcp-connecting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ describe("InteractiveMode MCP connecting banner", () => {
expect(showStatusSpy).toHaveBeenCalledWith(formatMCPConnectingMessage(serverNames));
});

it("does not render the mcp:connecting status when startup.quiet is enabled", () => {
session.settings.set("startup.quiet", true);
const showStatusSpy = vi.spyOn(mode, "showStatus").mockImplementation(() => {});

eventBus.emit(MCP_CONNECTING_EVENT_CHANNEL, {
serverNames: ["sequential", "critic"],
} satisfies McpConnectingEvent);

expect(showStatusSpy).not.toHaveBeenCalled();
});

it("rejects a malformed mcp:connecting payload via the guard instead of letting it throw", () => {
const showStatusSpy = vi.spyOn(mode, "showStatus").mockImplementation(() => {});
const warnSpy = vi.spyOn(logger, "warn").mockImplementation(() => {});
Expand Down
Loading