@oh-my-pi/pi-coding-agent 15.4.2 → 15.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [15.4.3] - 2026-05-26
6
+
7
+ ### Fixed
8
+
9
+ - Fixed Google Vertex cached project discovery replacing the bundled fallback catalog so `/models` does not keep showing outdated Gemini entries after authoritative Vertex discovery ([#1412](https://github.com/can1357/oh-my-pi/issues/1412)).
10
+
5
11
  ## [15.4.2] - 2026-05-26
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-coding-agent",
4
- "version": "15.4.2",
4
+ "version": "15.4.3",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -47,12 +47,12 @@
47
47
  "@agentclientprotocol/sdk": "0.21.0",
48
48
  "@babel/parser": "^7.29.3",
49
49
  "@mozilla/readability": "^0.6.0",
50
- "@oh-my-pi/omp-stats": "15.4.2",
51
- "@oh-my-pi/pi-agent-core": "15.4.2",
52
- "@oh-my-pi/pi-ai": "15.4.2",
53
- "@oh-my-pi/pi-natives": "15.4.2",
54
- "@oh-my-pi/pi-tui": "15.4.2",
55
- "@oh-my-pi/pi-utils": "15.4.2",
50
+ "@oh-my-pi/omp-stats": "15.4.3",
51
+ "@oh-my-pi/pi-agent-core": "15.4.3",
52
+ "@oh-my-pi/pi-ai": "15.4.3",
53
+ "@oh-my-pi/pi-natives": "15.4.3",
54
+ "@oh-my-pi/pi-tui": "15.4.3",
55
+ "@oh-my-pi/pi-utils": "15.4.3",
56
56
  "@puppeteer/browsers": "^2.13.0",
57
57
  "@types/turndown": "5.0.6",
58
58
  "@xterm/headless": "^6.0.0",
@@ -291,6 +291,28 @@ export function mergeDiscoveredModel<TApi extends Api>(
291
291
  return model;
292
292
  }
293
293
 
294
+ function isAuthoritativeProjectCatalogModel(model: Model<Api>): boolean {
295
+ return (
296
+ model.provider === "google-vertex" &&
297
+ model.api === "openai-completions" &&
298
+ model.baseUrl.includes("/endpoints/openapi")
299
+ );
300
+ }
301
+
302
+ function providersWithAuthoritativeProjectCatalog(models: readonly Model<Api>[]): Set<string> {
303
+ const providers = new Set<string>();
304
+ for (const model of models) {
305
+ if (isAuthoritativeProjectCatalogModel(model)) {
306
+ providers.add(model.provider);
307
+ }
308
+ }
309
+ return providers;
310
+ }
311
+
312
+ function dropProviderModels(models: readonly Model<Api>[], providers: ReadonlySet<string>): Model<Api>[] {
313
+ return models.filter(model => !providers.has(model.provider));
314
+ }
315
+
294
316
  interface DiscoveryProviderConfig {
295
317
  provider: string;
296
318
  api: Api;
@@ -877,9 +899,13 @@ export class ModelRegistry {
877
899
  this.#equivalenceConfig = equivalence;
878
900
 
879
901
  this.#addImplicitDiscoverableProviders(configuredProviders);
880
- const builtInModels = this.#applyHardcodedModelPolicies(this.#loadBuiltInModels(overrides));
902
+ let builtInModels = this.#applyHardcodedModelPolicies(this.#loadBuiltInModels(overrides));
881
903
  const cachedStandardModels = this.#applyHardcodedModelPolicies(this.#loadCachedStandardProviderModels());
882
904
  const cachedDiscoveries = this.#applyHardcodedModelPolicies(this.#loadCachedDiscoverableModels());
905
+ const cachedAuthoritativeProviders = providersWithAuthoritativeProjectCatalog(cachedStandardModels);
906
+ if (cachedAuthoritativeProviders.size > 0) {
907
+ builtInModels = dropProviderModels(builtInModels, cachedAuthoritativeProviders);
908
+ }
883
909
  const resolvedDefaults = this.#mergeResolvedModels(
884
910
  this.#mergeResolvedModels(builtInModels, cachedStandardModels),
885
911
  cachedDiscoveries,
@@ -1229,7 +1255,10 @@ export class ModelRegistry {
1229
1255
  ),
1230
1256
  ),
1231
1257
  );
1232
- const resolved = this.#mergeResolvedModels(this.#models, discoveredModels);
1258
+ const authoritativeProviders = providersWithAuthoritativeProjectCatalog(discoveredModels);
1259
+ const baseModels =
1260
+ authoritativeProviders.size > 0 ? dropProviderModels(this.#models, authoritativeProviders) : this.#models;
1261
+ const resolved = this.#mergeResolvedModels(baseModels, discoveredModels);
1233
1262
  const withConfigModels = this.#mergeCustomModels(resolved, this.#customModelOverlays);
1234
1263
  // Merge runtime extension models so they survive online discovery completion
1235
1264
  const combined = this.#mergeCustomModels(withConfigModels, this.#runtimeModelOverlays);
package/src/tools/gh.ts CHANGED
@@ -1748,9 +1748,13 @@ async function fetchRunsForCommit(
1748
1748
  cwd: string,
1749
1749
  repo: string,
1750
1750
  headSha: string,
1751
- branch: string | undefined,
1752
1751
  signal?: AbortSignal,
1753
1752
  ): Promise<GhRunSnapshot[]> {
1753
+ // Filter only by `head_sha`. The SHA uniquely identifies the commit, so
1754
+ // adding the GitHub `branch=` filter would wrongly exclude workflow runs
1755
+ // whose `head_branch` is not the local checkout — e.g. tag-push triggered
1756
+ // release workflows (`head_branch=v1.2.3`) or PR-triggered runs
1757
+ // (`head_branch=<pr head>`). See coding-agent issue tracker for details.
1754
1758
  const response = await git.github.json<GhActionsRunListResponse>(
1755
1759
  cwd,
1756
1760
  [
@@ -1762,7 +1766,6 @@ async function fetchRunsForCommit(
1762
1766
  `head_sha=${headSha}`,
1763
1767
  "-F",
1764
1768
  `per_page=${RUN_JOBS_PAGE_SIZE}`,
1765
- ...(branch ? ["-F", `branch=${branch}`] : []),
1766
1769
  ],
1767
1770
  signal,
1768
1771
  { repoProvided: true },
@@ -3406,7 +3409,7 @@ async function executeRunWatch(
3406
3409
  throwIfAborted(signal);
3407
3410
  pollCount += 1;
3408
3411
 
3409
- let runs = await fetchRunsForCommit(session.cwd, repo, headSha, branch, signal);
3412
+ let runs = await fetchRunsForCommit(session.cwd, repo, headSha, signal);
3410
3413
  const details = buildCommitRunWatchDetails(repo, headSha, branch, runs, {
3411
3414
  state: "watching",
3412
3415
  pollCount,
@@ -3434,7 +3437,7 @@ async function executeRunWatch(
3434
3437
  }),
3435
3438
  });
3436
3439
  await scheduler.wait(graceSeconds * 1000, { signal });
3437
- runs = await fetchRunsForCommit(session.cwd, repo, headSha, branch, signal);
3440
+ runs = await fetchRunsForCommit(session.cwd, repo, headSha, signal);
3438
3441
  }
3439
3442
 
3440
3443
  const failedJobLogs = await fetchFailedJobLogs(