Skip to content
Open
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 @@ -5,6 +5,10 @@
### Fixed

- Fixed all extension loading silently failing on the cross-compiled `omp-darwin-arm64` release binary (downloaded directly or via a Homebrew tap wrapper) because `__computeBunfsPackageRoot` mis-handled `import.meta.dir = "//root/omp-darwin-arm64"`. Bun 1.3.14 reports `<bunfs-root>/<binary-name>` for the compiled entry's `import.meta.dir`, but the pre-fix function joined `metaDir + "packages"` and produced `/root/omp-darwin-arm64/packages` — the binary basename was baked into every bunfs path, so the TypeBox/legacy-pi shims and every `@oh-my-pi/pi-*` package-root override failed `existsSync` validation and `resolveCanonicalPiSpecifier` fell through to a bunfs `Bun.resolveSync` that also could not find the module. The function now detects the bunfs-root + binary-basename shape (`path.basename(path.dirname(metaDir)) === "root"`) and strips the trailing binary segment by slicing the original `metaDir`; the production bunfs shim join path also preserves Bun's bunfs-native `//root` / `B:\~BUN\root` prefix that `path.join` would otherwise collapse. ([#3329](https://github.com/can1357/oh-my-pi/issues/3329))
### Changed

- Consolidated duplicate `formatProviderName` implementations from three files into a shared helper in `slash-commands/helpers/format.ts`.

## [16.1.16] - 2026-06-23

### Breaking Changes
Expand Down
8 changes: 1 addition & 7 deletions packages/coding-agent/src/cli/usage-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { formatDuration, formatNumber } from "@oh-my-pi/pi-utils";
import chalk from "chalk";
import { ModelRegistry } from "../config/model-registry";
import { discoverAuthStorage } from "../sdk";
import { formatProviderName } from "../slash-commands/helpers/format";

const BAR_WIDTH = 28;

Expand Down Expand Up @@ -175,13 +176,6 @@ function aggregateStatus(limits: UsageLimit[]): LimitStatus {
return "unknown";
}

function formatProviderName(provider: string): string {
return provider
.split(/[-_]/g)
.map(part => (part ? part[0].toUpperCase() + part.slice(1) : ""))
.join(" ");
}

function formatUnitValue(value: number, unit: UsageUnit): string {
if (unit === "usd") return `$${value.toFixed(2)}`;
return formatNumber(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import type { CompactMode } from "../../session/compact-modes";
import type { NewSessionOptions } from "../../session/session-entries";
import { formatShakeSummary, type ShakeMode, type ShakeResult } from "../../session/shake-types";
import { limitMatchesActiveAccount } from "../../slash-commands/helpers/active-oauth-account";
import { formatProviderName } from "../../slash-commands/helpers/format";
import { outputMeta } from "../../tools/output-meta";
import { resolveToCwd, stripOuterDoubleQuotes } from "../../tools/path-utils";
import { replaceTabs } from "../../tools/render-utils";
Expand Down Expand Up @@ -1270,13 +1271,6 @@ function truncateJobLabel(label: string, maxWidth: number): string {
return `${out}…`;
}

function formatProviderName(provider: string): string {
return provider
.split(/[-_]/g)
.map(part => (part ? part[0].toUpperCase() + part.slice(1) : ""))
.join(" ");
}

function formatNumber(value: number, maxFractionDigits = 1): string {
return new Intl.NumberFormat("en-US", { maximumFractionDigits: maxFractionDigits }).format(value);
}
Expand Down
8 changes: 8 additions & 0 deletions packages/coding-agent/src/slash-commands/helpers/format.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { shimmerText } from "../../modes/theme/shimmer";
import { theme as currentTheme, type Theme } from "../../modes/theme/theme";

/** Title-case a provider id for display (e.g. "opencode-go" → "Opencode Go"). */
export function formatProviderName(provider: string): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: this touches packages/coding-agent user-facing usage rendering, but the PR does not add an ## [Unreleased] entry in packages/coding-agent/CHANGELOG.md. Repo convention requires a changelog entry for each touched package before merge.

return provider
.split(/[-_]/g)
.map(part => (part ? part[0]!.toUpperCase() + part.slice(1) : ""))
.join(" ");
}

/** Format a millisecond duration as a coarse-grained human label. */
export function formatDuration(ms: number): string {
const seconds = Math.max(0, Math.round(ms / 1000));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ import type { UsageLimit, UsageReport } from "@oh-my-pi/pi-ai";
import type { OAuthAccountIdentity } from "../../session/auth-storage";
import type { SlashCommandRuntime } from "../types";
import { reportMatchesActiveAccount } from "./active-oauth-account";
import { formatDuration, renderAsciiBar } from "./format";

function formatProviderName(provider: string): string {
return provider
.split(/[-_]/g)
.map(part => (part ? part[0].toUpperCase() + part.slice(1) : ""))
.join(" ");
}
import { formatDuration, formatProviderName, renderAsciiBar } from "./format";

function formatUsageAmount(limit: UsageLimit): string {
const amount = limit.amount;
Expand Down
Loading