Merge remote-tracking branch 'origin/master' into codex/sandbox-policy-context
This commit is contained in:
6
examples/headless-agent/tests/fixtures/startup-activation-error/activation-error.mjs
vendored
Normal file
6
examples/headless-agent/tests/fixtures/startup-activation-error/activation-error.mjs
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/** Fail activation with a deterministic stack so the user-visible startup diagnostic is snapshot-stable. */
|
||||
export function apply() {
|
||||
const failure = new Error('startup activation snapshot failure')
|
||||
failure.stack = 'Error: startup activation snapshot failure\n at activation-error-fixture'
|
||||
throw failure
|
||||
}
|
||||
2
examples/headless-agent/tests/fixtures/startup-activation-error/cordis.yml
vendored
Normal file
2
examples/headless-agent/tests/fixtures/startup-activation-error/cordis.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
- id: activation-error
|
||||
name: ./activation-error.mjs
|
||||
@@ -8,6 +8,7 @@
|
||||
- id: telemetry-redact-rule
|
||||
name: './telemetry-redact-rule.ts'
|
||||
|
||||
# Managed child-process groups required by the bash executor.
|
||||
- id: subprocess
|
||||
name: '@deepseek-ai/dsh-subprocess-local'
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ const credentialsScenarioDir = join(snapshotsDir, 'missing-credential')
|
||||
const credentialsConfigPath = fileURLToPath(new URL('../credentials.cordis.snapshot.yml', import.meta.url))
|
||||
const ralphScenarioDir = join(snapshotsDir, 'ralph-loop')
|
||||
const ralphConfigPath = fileURLToPath(new URL('../ralph.cordis.snapshot.yml', import.meta.url))
|
||||
const startupFailureConfigPath = fileURLToPath(new URL('./fixtures/startup-activation-error/cordis.yml', import.meta.url))
|
||||
const startupFailureExpected = join(snapshotsDir, 'startup-activation-error', 'stderr.expected.txt')
|
||||
const binScript = fileURLToPath(new URL('../../../packages/examples/cli-demo/src/bin.ts', import.meta.url))
|
||||
const tsconfigPath = fileURLToPath(new URL('../../../tsconfig.json', import.meta.url))
|
||||
const reasoningConfigPath = fileURLToPath(new URL('./fixtures/cli.cordis.yml', import.meta.url))
|
||||
@@ -167,6 +169,20 @@ async function persistedLogs(cwd: string): Promise<PersistedLog[]> {
|
||||
}
|
||||
|
||||
describe('headless stream-json snapshots', () => {
|
||||
it('prints the original Loader activation error through the assembled one-shot app', async () => {
|
||||
const result = await runLoaderSmoke({
|
||||
label: 'headless startup activation error snapshot',
|
||||
tempDirPrefix: 'headless-snapshot-startup-error-',
|
||||
binScript,
|
||||
configPath: startupFailureConfigPath,
|
||||
binArgs: ['--config', startupFailureConfigPath, '--output-format', 'stream-json', 'unreachable task'],
|
||||
tsconfigPath,
|
||||
expectedExitCode: 1,
|
||||
})
|
||||
expect(result.stdout).toBe('')
|
||||
await expect(result.stderr).toMatchFileSnapshot(startupFailureExpected)
|
||||
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
|
||||
|
||||
it('retries a transient provider failure through the one-shot app', async () => {
|
||||
const prompt = await scenarioPrompt(retryScenarioDir, 'provider-retry')
|
||||
const streamExpected = join(retryScenarioDir, 'stream-json.expected.jsonl')
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
dsh-cli-demo: dsh-cli-demo: 1 entry did not activate
|
||||
./activation-error.mjs: Error: startup activation snapshot failure
|
||||
at activation-error-fixture
|
||||
Reference in New Issue
Block a user