fix: fallback on retryable model errors - #1
Open
tomllt wants to merge 4 commits into
Open
Conversation
tomllt
pushed a commit
that referenced
this pull request
Jul 8, 2026
…n-gsd#818 cross-cutting (open-gsd#1129) ## TL;DR **What:** Cross-cutting parent-workspace fixes found while completing open-gsd#818: a `/gsd doctor` probe that validates declared child repos, and a validation warning for the `mode:team` + `workspace.mode:parent` footgun. **Why:** Doctor reported "no problems" for a typo'd child-repo path, and team+parent silently degraded push/PR to the root repo. **How:** New `checkWorkspaceRepositoryHealth` doctor probe (no-op for project mode) + a cross-axis preferences warning pointing at ADR-044. ## What - **#1 Doctor probe** (`doctor.ts`, `doctor-types.ts`) — `checkWorkspaceRepositoryHealth`: for parent-mode projects, flags `workspace_repo_path_missing` (declared path absent on disk) and `workspace_repo_not_a_repo` (path exists but isn't a git repo at its **own** root). The registry only checked paths stay inside the project root — never existence or git-ness — so `path: frontned` (typo) built cleanly and doctor reported clean. The git-repo check compares against `git rev-parse --show-toplevel` (realpath-normalized) so a plain dir nested in the parent repo can't pass via the enclosing parent's `.git`. - **open-gsd#2 Validation warning** (`preferences-validation.ts`) — `mode:team` + `workspace.mode:parent` now warns that team branch-push/PR resolves at the project root and won't push child repos, pointing at ADR-044. Previously this combination was silently broken (push/PR root-only). - **open-gsd#6 Regression guard** — a new doctor test asserts the common layout (parent is a plain folder holding child git repos, not itself a git repo) is handled gracefully. ## Why These are cross-cutting concerns the issue's 6 gaps didn't enumerate: - Doctor is the natural place users diagnose misconfiguration; a silent typo is the worst failure mode. - The two `mode` axes (team vs parent-workspace) both touch git/push but were never cross-checked, so the combination silently lost team mode's push value. ## How / Verification - `tsc --noEmit --project tsconfig.extensions.json` — clean. - `pnpm run verify:fast` — all fast-gates passed. - `doctor-workspace.test.ts` — 5/5 pass (missing path, not-a-repo, valid repos, project-mode no-op, non-git parent). - `preferences.test.ts` — 102/102 pass (2 new: team+parent warns; team alone doesn't). - `doctor-empty-worktree.test.ts` — 3/3 pass (existing doctor probes unaffected). ### Scope This is a focused diagnostics/validation bundle. Two related findings are handled separately: - **open-gsd#5** (`/gsd status` per-repo signal) — its own follow-up. - **open-gsd#3 / open-gsd#4** (runtime repo write-guard; parallel orchestration) — design-level / RFC-blocked; documented in ADR-044, not blind-coded here. AI-assisted; no AI credited as author. Change type: `feat` / `test` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are additive diagnostics, docs, and a CI checkout tweak; no auth, data migration, or runtime execution-path changes beyond read-only git probes during doctor. > > **Overview** > Adds **parent-workspace diagnostics** so misconfigured child repos are visible instead of a clean doctor run, plus a **merged-preference warning** when team mode and parent workspace are combined. > > **`/gsd doctor`** (parent `workspace.mode` only) now validates each declared child repo: missing paths raise `workspace_repo_path_missing`; paths that are not a git root (including dirs that only inherit the parent’s `.git`) raise `workspace_repo_not_a_repo`, using `git rev-parse --show-toplevel` with realpath normalization and `GIT_NO_PROMPT_ENV`. > > **Preferences** emit a cross-axis warning when effective settings are `mode: team` and `workspace.mode: parent` (root-only push/PR; ADR-044), via `crossAxisPreferenceWarnings` on validation, effective load, and doctor/preflight diagnostics. > > User docs cover the new doctor codes and the team+parent footgun. **CI** checkouts detach `refs/checkout-ref` after fetch instead of `$GITHUB_SHA`. New tests cover workspace doctor cases and preference merge behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a8945df. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/open-gsd/codesmith/gsd-pi/pr/1129"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <sup>Need help on this PR? Tag <code>/codesmith</code> with what you need. Autofix is enabled.</sup> <!-- codesmith:autofix:enabled --> <!-- /codesmith:footer -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
FallbackResolverFallbackResolvermarked the current provider as exhausted before scanning the chain, which incorrectly blocked backup models on the same providerVerification
pnpm --filter @gsd/agent-core run buildpnpm --filter @gsd/agent-core test