@oss-autopilot/core 1.17.0 → 1.17.1

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.
@@ -236,9 +236,15 @@ export async function runStartup() {
236
236
  dashboardStatus = refreshed ? 'refreshed' : 'running';
237
237
  }
238
238
  else {
239
- openInBrowser(spaResult.url);
240
239
  dashboardStatus = 'opened';
241
240
  }
241
+ // Always surface the dashboard: `open`/`xdg-open`/`start` focus an
242
+ // existing tab matching the URL instead of duplicating it, so this is
243
+ // safe whether the server was just started or was already running.
244
+ // Closes #830 properly. The original fix assumed "server running"
245
+ // implied "tab open", but the user can close the tab while the daemon
246
+ // keeps running, leaving subsequent /oss runs with no visible dashboard.
247
+ openInBrowser(spaResult.url);
242
248
  }
243
249
  else {
244
250
  console.error('[STARTUP] Dashboard SPA assets not found. Build with: cd packages/dashboard && pnpm run build');
@@ -17,7 +17,7 @@ import { getStateManager } from './state.js';
17
17
  import { daysBetween, parseGitHubUrl, extractOwnerRepo, isOwnRepo, DEFAULT_CONCURRENCY } from './utils.js';
18
18
  import { determineStatus } from './status-determination.js';
19
19
  import { runWorkerPool } from './concurrency.js';
20
- import { ConfigurationError, ValidationError, errorMessage, getHttpStatusCode } from './errors.js';
20
+ import { ConfigurationError, ValidationError, errorMessage, getHttpStatusCode, isRateLimitOrAuthError, } from './errors.js';
21
21
  import { paginateAll } from './pagination.js';
22
22
  import { debug, warn, timed } from './logger.js';
23
23
  import { getHttpCache, cachedRequest } from './http-cache.js';
@@ -106,6 +106,34 @@ export class PRMonitor {
106
106
  // previously silently dropped the overflow; now the caller can surface
107
107
  // it so the daily digest doesn't quietly report a partial view.
108
108
  const warnings = [];
109
+ // Guardrail: if the Search API returned zero PRs, cross-check the
110
+ // configured username against the authenticated viewer. A real failure
111
+ // mode was a stale/placeholder username (e.g. "example-user") silently
112
+ // producing zero results with no error — the dashboard just showed
113
+ // "0 active PRs" and looked like a fresh install. getAuthenticated is
114
+ // advisory; a failure here never breaks the fetch.
115
+ if (totalCount === 0) {
116
+ try {
117
+ const { data: viewer } = await this.octokit.users.getAuthenticated();
118
+ if (viewer.login.toLowerCase() !== config.githubUsername.toLowerCase()) {
119
+ const message = `Configured GitHub username @${config.githubUsername} does not match ` +
120
+ `authenticated user @${viewer.login}. Did you mean to run ` +
121
+ `\`oss-autopilot config username ${viewer.login}\`? Zero PRs returned.`;
122
+ warnings.push(message);
123
+ warn(MODULE, message);
124
+ }
125
+ }
126
+ catch (err) {
127
+ // Rate-limit/401/403 errors must abort the run just like every sibling
128
+ // fetch in this pipeline — swallowing them here would mask the exact
129
+ // class of failure the guardrail is meant to surface (e.g. revoked
130
+ // token returning 401 while the unauthenticated Search above still
131
+ // succeeds with zero results).
132
+ if (isRateLimitOrAuthError(err))
133
+ throw err;
134
+ debug(MODULE, `Could not cross-check viewer login: ${errorMessage(err)}`);
135
+ }
136
+ }
109
137
  if (totalCount > SEARCH_API_RESULT_CAP) {
110
138
  warnings.push(`GitHub Search API returned ${totalCount} PRs for @${config.githubUsername}, ` +
111
139
  `but results are capped at ${SEARCH_API_RESULT_CAP}. ` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {