diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index bd81a6f64..ea5f18e03 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -305,6 +305,9 @@ - Fixed remote or LAN local-engine endpoints being ignored during model discovery: the llama.cpp and Ollama probes used timeouts tuned for loopback, so a host reached over the network could exceed them and return no models, while changing `OLLAMA_BASE_URL`/`OLLAMA_HOST` could keep reusing a fresh cache from the previous endpoint. Non-loopback hosts now get a generous discovery timeout, and Ollama cache rows are scoped to the normalized endpoint ([#7087](https://github.com/can1357/oh-my-pi/issues/7087)). - Fixed `omp install` failing extension validation for pi extensions that import `createEditTool` or `createWriteTool` (e.g. gentle-pi) — the legacy `@oh-my-pi/pi-coding-agent` shim exported the read/bash/grep/find/ls tool factories but omitted the edit and write ones, so a named import threw Bun's static "Export named X not found" error. Added `createEditTool`/`createEditToolDefinition` and `createWriteTool`/`createWriteToolDefinition` to match the upstream pi surface ([#7094](https://github.com/can1357/oh-my-pi/issues/7094)). - Fixed Python eval's loopback tool bridge being routed through macOS system HTTP proxies, which caused `parallel()` tool reads to fail with `ConnectionRefusedError` after a local proxy stopped. +### Fixed + +- The status-line `session_name` segment now honors the `statusLine.sessionAccent` setting: when disabled, the rendered session name falls back to the theme `accent` color instead of emitting the hash-derived session accent, matching the gap-fill divider behavior ([#7867](https://github.com/can1357/oh-my-pi/pull/7867)). ## [17.2.0] - 2026-07-30 diff --git a/packages/coding-agent/src/modes/components/status-line/component.ts b/packages/coding-agent/src/modes/components/status-line/component.ts index e06a9198f..e423de910 100644 --- a/packages/coding-agent/src/modes/components/status-line/component.ts +++ b/packages/coding-agent/src/modes/components/status-line/component.ts @@ -1556,6 +1556,7 @@ export class StatusLineComponent implements Component { return { session: this.session, focusedAgentId: this.#focusedAgentId, + sessionAccent: this.#resolveSettings().sessionAccent !== false, activeRepo: activeRepoCache.activeRepo, width, options: segmentOptions ?? {}, diff --git a/packages/coding-agent/src/modes/components/status-line/segments.ts b/packages/coding-agent/src/modes/components/status-line/segments.ts index 4bb1b3ae0..e3ce7f091 100644 --- a/packages/coding-agent/src/modes/components/status-line/segments.ts +++ b/packages/coding-agent/src/modes/components/status-line/segments.ts @@ -592,7 +592,7 @@ const sessionNameSegment: StatusLineSegment = { const name = sessionManager?.getSessionName(); if (!name) return { content: "", visible: false }; - const accentEnabled = ctx.session.settings.get("statusLine.sessionAccent") !== false; + const accentEnabled = ctx.sessionAccent !== false; const ansi = accentEnabled ? (getSessionAccentAnsi( getSessionAccentHex(name, theme.getMajorThemeColorHexes(), theme.accentSurfaceLuminance), diff --git a/packages/coding-agent/src/modes/components/status-line/types.ts b/packages/coding-agent/src/modes/components/status-line/types.ts index 6c2b64d23..a3fa8bfd2 100644 --- a/packages/coding-agent/src/modes/components/status-line/types.ts +++ b/packages/coding-agent/src/modes/components/status-line/types.ts @@ -52,6 +52,8 @@ export interface SegmentContext { session: AgentSession; /** Focused subagent id while the view is proxied at its session, undefined otherwise. */ focusedAgentId?: string | undefined; + /** Resolved `statusLine.sessionAccent` from the component's effective settings; undefined/false disables hash-derived accent colors. */ + sessionAccent?: boolean; activeRepo: ActiveRepoContext | null; width: number; options: StatusLineSegmentOptions; diff --git a/packages/coding-agent/test/status-line-overflow.test.ts b/packages/coding-agent/test/status-line-overflow.test.ts index 76db9c469..ff3be4e8e 100644 --- a/packages/coding-agent/test/status-line-overflow.test.ts +++ b/packages/coding-agent/test/status-line-overflow.test.ts @@ -26,14 +26,16 @@ afterAll(() => { }); /** Minimal SegmentContext factory — only path/git fields matter for these tests. */ -function createCtx(overrides?: { pathMaxLength?: number; branch?: string | null }): SegmentContext { +function createCtx(overrides?: { pathMaxLength?: number; branch?: string | null; sessionName?: string; sessionAccent?: boolean }): SegmentContext { + const hasName = overrides?.sessionName !== undefined; return { session: { state: {}, isFastModeEnabled: () => false, modelRegistry: { isUsingOAuth: () => false }, - sessionManager: undefined, + sessionManager: hasName ? { getSessionName: () => overrides.sessionName } : undefined, } as unknown as SegmentContext["session"], + sessionAccent: overrides?.sessionAccent, width: 120, compactThinkingLevel: false, options: { @@ -160,6 +162,25 @@ describe("status line session accent", () => { // for its own text — we only care that the gap is not accent-painted. expect(border).not.toContain(`${ansi}${theme.boxRound.horizontal}`); }); + + it("renders the session name with the theme accent color when the accent is disabled", () => { + const ansi = accentAnsi(); + expect(ansi).toBeDefined(); + const disabled = renderSegment("session_name", createCtx({ sessionName: "Named session", sessionAccent: false })); + expect(disabled.visible).toBe(true); + // Positive: the name uses the theme accent color, not the hash-derived session ANSI. + expect(disabled.content).toContain(theme.getFgAnsi("accent")); + // Negative: the hash-derived session ANSI must not appear for the name text. + expect(disabled.content).not.toContain(ansi); + }); + + it("still renders the session name with the hash-derived accent when enabled", () => { + const ansi = accentAnsi(); + expect(ansi).toBeDefined(); + const enabled = renderSegment("session_name", createCtx({ sessionName: "Named session", sessionAccent: true })); + expect(enabled.visible).toBe(true); + expect(enabled.content).toContain(ansi); + }); }); describe("status line focused-agent dimming", () => {