Skip to content

Commit c13baa7

Browse files
committed
fix: finalize gpt-5.4.3 review follow-ups
- remove redundant fallback seed mutex in storage path - clarify fallback policy scope for gpt-5.4-pro docs - rename storage fallback test to match serialized execution
1 parent 4e5ca32 commit c13baa7

File tree

3 files changed

+27
-39
lines changed

3 files changed

+27
-39
lines changed

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Safe mode effects:
207207
| Model | Variants | Notes |
208208
|-------|----------|-------|
209209
| `gpt-5.4` | none, low, medium, high, xhigh | Latest GPT-5.4 (1,000,000 context) |
210-
| `gpt-5.4-pro` | low, medium, high, xhigh | Optional manual model for deeper reasoning; fallback default is `gpt-5.4-pro -> gpt-5.4` (1,000,000 context) |
210+
| `gpt-5.4-pro` | low, medium, high, xhigh | Optional manual model for deeper reasoning; when `unsupportedCodexPolicy=fallback`, fallback includes `gpt-5.4-pro -> gpt-5.4` (1,000,000 context) |
211211
| `gpt-5-codex` | low, medium, high | Canonical Codex for code generation |
212212
| `gpt-5.3-codex-spark` | low, medium, high, xhigh | Optional manual model; entitlement-gated by account/workspace |
213213
| `gpt-5.1-codex-max` | low, medium, high, xhigh | Maximum context |

lib/storage.ts

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export function formatStorageErrorHint(error: unknown, path: string): string {
107107
}
108108

109109
let storageMutex: Promise<void> = Promise.resolve();
110-
let fallbackSeedMutex: Promise<void> = Promise.resolve();
111110

112111
function withStorageLock<T>(fn: () => Promise<T>): Promise<T> {
113112
const previousMutex = storageMutex;
@@ -118,15 +117,6 @@ function withStorageLock<T>(fn: () => Promise<T>): Promise<T> {
118117
return previousMutex.then(fn).finally(() => releaseLock());
119118
}
120119

121-
function withFallbackSeedLock<T>(fn: () => Promise<T>): Promise<T> {
122-
const previousMutex = fallbackSeedMutex;
123-
let releaseLock: () => void;
124-
fallbackSeedMutex = new Promise<void>((resolve) => {
125-
releaseLock = resolve;
126-
});
127-
return previousMutex.then(fn).finally(() => releaseLock());
128-
}
129-
130120
const WINDOWS_RENAME_RETRY_ATTEMPTS = 5;
131121
const WINDOWS_RENAME_RETRY_BASE_DELAY_MS = 10;
132122
const PRE_IMPORT_BACKUP_WRITE_TIMEOUT_MS = 3_000;
@@ -770,36 +760,34 @@ async function loadAccountsInternal(
770760
if (!globalFallback) return null;
771761

772762
if (persistMigration) {
773-
await withFallbackSeedLock(async () => {
774-
const seedPath = getStoragePath();
775-
try {
776-
await fs.access(seedPath);
777-
return;
778-
} catch (accessError) {
779-
const accessCode = (accessError as NodeJS.ErrnoException).code;
780-
if (accessCode !== "ENOENT") {
781-
log.warn("Failed to inspect project seed path before fallback seeding", {
782-
path: seedPath,
783-
error: String(accessError),
784-
});
785-
return;
786-
}
787-
// File is missing; proceed with seed write.
788-
}
789-
790-
try {
791-
await persistMigration(globalFallback);
792-
log.info("Seeded project account storage from global fallback", {
793-
path: seedPath,
794-
accounts: globalFallback.accounts.length,
795-
});
796-
} catch (persistError) {
797-
log.warn("Failed to seed project storage from global fallback", {
763+
const seedPath = getStoragePath();
764+
try {
765+
await fs.access(seedPath);
766+
return globalFallback;
767+
} catch (accessError) {
768+
const accessCode = (accessError as NodeJS.ErrnoException).code;
769+
if (accessCode !== "ENOENT") {
770+
log.warn("Failed to inspect project seed path before fallback seeding", {
798771
path: seedPath,
799-
error: String(persistError),
772+
error: String(accessError),
800773
});
774+
return globalFallback;
801775
}
802-
});
776+
// File is missing; proceed with seed write.
777+
}
778+
779+
try {
780+
await persistMigration(globalFallback);
781+
log.info("Seeded project account storage from global fallback", {
782+
path: seedPath,
783+
accounts: globalFallback.accounts.length,
784+
});
785+
} catch (persistError) {
786+
log.warn("Failed to seed project storage from global fallback", {
787+
path: seedPath,
788+
error: String(persistError),
789+
});
790+
}
803791
}
804792

805793
return globalFallback;

test/storage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ describe("storage", () => {
18251825
expect(seeded.accounts?.[0]?.accountId).toBe("global-account");
18261826
});
18271827

1828-
it("seeds project storage only once for concurrent global-fallback loads", async () => {
1828+
it("seeds project storage only once across serialized global-fallback loads", async () => {
18291829
const fakeHome = join(testWorkDir, "home-fallback-concurrent");
18301830
const projectDir = join(testWorkDir, "project-fallback-concurrent");
18311831
const projectGitDir = join(projectDir, ".git");

0 commit comments

Comments
 (0)