diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index da7b4bf4f..0c465f286 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -47,6 +47,7 @@ - Fixed `task.maxRuntimeMs` losing wall-clock aborts that fired during pre-prompt session setup by re-checking the abort signal immediately before issuing the model prompt, so a stalled subagent now exits with the runtime-limit reason instead of hanging through setup races - Fixed late `yield` events landing after a wall-clock timeout from flipping a timed-out subagent to a successful exit, so the reported `aborted` flag and exit code now always reflect the runtime-limit breach while yield payloads remain in `extractedToolData` - Fixed async-task progress consumer to copy `contextTokens` and `contextWindow` from the completed `SingleResult` onto `AgentProgress`, so UI gauges keep showing per-turn context after a backgrounded task finishes +- Fixed the status-line `path` segment ignoring `stripWorkPrefix: false` when selecting the folder icon for scratch directories. The icon selection now respects the same gate as the scratch path stripping, so disabling `stripWorkPrefix` keeps the regular `folder` icon even when the project directory is inside a scratch root. ## [15.0.2] - 2026-05-15 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 7c3ef6fb4..3e6c5459c 100644 --- a/packages/coding-agent/src/modes/components/status-line/segments.ts +++ b/packages/coding-agent/src/modes/components/status-line/segments.ts @@ -199,7 +199,8 @@ const pathSegment: StatusLineSegment = { pwd = `${ellipsis}${pwd.slice(-sliceLen)}`; } - const icon = scratch ? theme.icon.scratchFolder : theme.icon.folder; + const showScratchIcon = scratch && opts.stripWorkPrefix !== false; + const icon = showScratchIcon ? theme.icon.scratchFolder : theme.icon.folder; const content = withIcon(icon, pwd); return { content: theme.fg("statusLinePath", content), visible: true }; }, diff --git a/packages/coding-agent/test/status-line-path.test.ts b/packages/coding-agent/test/status-line-path.test.ts index eb33d9c0b..6fd3fed1f 100644 --- a/packages/coding-agent/test/status-line-path.test.ts +++ b/packages/coding-agent/test/status-line-path.test.ts @@ -124,6 +124,22 @@ describe("status line path segment", () => { } }); + it("keeps the folder icon for scratch paths when stripWorkPrefix is disabled", () => { + const scratchDir = fs.mkdtempSync(path.join(os.tmpdir(), "omp-status-line-scratch-noprefix-")); + try { + setProjectDir(scratchDir); + + const ctx = createPathContext(); + ctx.options.path = { ...ctx.options.path, stripWorkPrefix: false }; + const rendered = renderSegment("path", ctx); + expect(rendered.visible).toBe(true); + expect(rendered.content).toContain(theme.icon.folder); + expect(rendered.content).not.toContain(theme.icon.scratchFolder); + } finally { + fs.rmSync(scratchDir, { recursive: true, force: true }); + } + }); + it("keeps the folder icon for paths outside any scratch root", () => { const projectsRoot = path.join(os.homedir(), "Projects"); fs.mkdirSync(projectsRoot, { recursive: true });