mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 08:03:58 +00:00
fix(codex): name the stalled managed config
This commit is contained in:
@@ -4,6 +4,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import {
|
||||
getCodexConfigSyncStatus,
|
||||
reportCodexConfigSyncOutcome,
|
||||
resetCodexConfigSyncStallLatchForTests
|
||||
} from './config-sync-stall'
|
||||
import { syncSystemConfigIntoManagedCodexHome } from './codex-config-mirror'
|
||||
@@ -163,6 +164,19 @@ describe('reportCodexConfigSyncOutcome', () => {
|
||||
expect(String(stallLogs[0]?.[0])).toContain('unreadable-source')
|
||||
})
|
||||
|
||||
it('names the managed config when that is the unreadable file', () => {
|
||||
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
writeFileSync(systemConfigPath(), 'model = "gpt-5"\n', 'utf-8')
|
||||
mkdirSync(runtimeConfigPath())
|
||||
|
||||
reportCodexConfigSyncOutcome(homes.runtimeHomePath, getCodexConfigSyncStatus(homes))
|
||||
|
||||
const message = String(warn.mock.calls[0]?.[0])
|
||||
expect(message).toContain(runtimeConfigPath())
|
||||
expect(message).not.toContain(systemConfigPath())
|
||||
expect(message).toContain('The managed config must be readable before settings can sync.')
|
||||
})
|
||||
|
||||
it('clears a stall without claiming the source became readable', () => {
|
||||
// Why: a removed runtime config also reads as synced, so "readable again"
|
||||
// would be a false claim about a source that is still gone.
|
||||
|
||||
@@ -94,6 +94,12 @@ export function reportCodexConfigSyncOutcome(
|
||||
return
|
||||
}
|
||||
stalledHomes.set(runtimeHomePath, status.reason)
|
||||
if (status.reason === 'managed-home-unavailable') {
|
||||
console.warn(
|
||||
`[codex-config] Config sync stalled (${status.reason}): ${join(runtimeHomePath, 'config.toml')} is unusable, so ${runtimeHomePath} keeps its last synced settings. The managed config must be readable before settings can sync.`
|
||||
)
|
||||
return
|
||||
}
|
||||
console.warn(
|
||||
`[codex-config] Config sync stalled (${status.reason}): ${status.systemConfigPath} is unusable, so ${runtimeHomePath} keeps its last synced settings. Edits to the source will not apply until it is readable.`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user