@marcusrbrown/infra 0.9.6 → 0.9.7
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/package.json
CHANGED
|
@@ -276,6 +276,32 @@ describe('cliproxy login', () => {
|
|
|
276
276
|
)
|
|
277
277
|
expect(calls).toHaveLength(1)
|
|
278
278
|
})
|
|
279
|
+
|
|
280
|
+
it('codex non-zero exit: error message includes exit code and v6.10.9 version requirement', async () => {
|
|
281
|
+
const {cliproxyLoginAction} = await import('./login')
|
|
282
|
+
const {spawnFn} = makeSpawnOk(1)
|
|
283
|
+
setValidEnv()
|
|
284
|
+
|
|
285
|
+
const error = await cliproxyLoginAction('codex', {}, spawnFn).catch((error_: unknown) => error_)
|
|
286
|
+
expect(error).toBeInstanceOf(Error)
|
|
287
|
+
const message = (error as Error).message
|
|
288
|
+
expect(message).toMatch(/exit code 1/)
|
|
289
|
+
expect(message).toMatch(/v6\.10\.9/)
|
|
290
|
+
expect(message).toMatch(/cliproxy-provider-version-skew\.md/)
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
it('codex non-zero exit: error message does not bleed into claude non-zero exit', async () => {
|
|
294
|
+
const {cliproxyLoginAction} = await import('./login')
|
|
295
|
+
const {spawnFn} = makeSpawnOk(2)
|
|
296
|
+
setValidEnv()
|
|
297
|
+
|
|
298
|
+
const error = await cliproxyLoginAction('claude', {}, spawnFn).catch((error_: unknown) => error_)
|
|
299
|
+
expect(error).toBeInstanceOf(Error)
|
|
300
|
+
const message = (error as Error).message
|
|
301
|
+
expect(message).toMatch(/Remote login command failed with exit code 2/)
|
|
302
|
+
expect(message).not.toMatch(/v6\.10\.9/)
|
|
303
|
+
expect(message).not.toMatch(/cliproxy-provider-version-skew/)
|
|
304
|
+
})
|
|
279
305
|
})
|
|
280
306
|
|
|
281
307
|
describe('ssh spawn contract', () => {
|
|
@@ -97,6 +97,14 @@ export async function cliproxyLoginAction(
|
|
|
97
97
|
|
|
98
98
|
const exitCode = await child.exited
|
|
99
99
|
if (exitCode !== 0) {
|
|
100
|
+
if (provider === 'codex') {
|
|
101
|
+
throw new Error(
|
|
102
|
+
`Remote login command failed with exit code ${exitCode}. ` +
|
|
103
|
+
`The most likely cause is that the droplet's CLIProxyAPI binary predates --codex-device-login support (requires v6.10.9+). ` +
|
|
104
|
+
`See docs/runbooks/cliproxy-provider-version-skew.md for diagnosis and remediation steps.`,
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
100
108
|
throw new Error(`Remote login command failed with exit code ${exitCode}`)
|
|
101
109
|
}
|
|
102
110
|
|