The loader smoke test

The loader smoke test boots an application fixture from its real entry point and configuration, inside an isolated temporary folder, and then drives exactly one task through the fixture's single top-level agent. Use it for keyless smoke tests that must prove the real boot path. To choose between the test tiers, see Testing tiers.

Boot a fixture

A run starts the fixture's own entry point as a child process, hands it the fixture's configuration and arguments, and reports what happened.

OptionWhat it sets
labelThe name the fixture is reported under in failures.
tempDirPrefixA prefix for the name of the temporary folder the smoke test creates.
binScriptThe fixture's entry point to launch.
configPathThe fixture's configuration file.
tsconfigPathThe TypeScript project that supplies source mode's workspace path map.
sourceImportHow source files are imported in source mode (tsx/esm).
expectedExitCodeThe exit code the run must end with; 0 unless you declare another.

Source mode and built mode

The isolated world

Drive a fixture turn

Failures you will meet

Limits

Questions, answered

When should I use the loader smoke test?

When a test must prove the real boot path: the fixture starts from its real entry point and configuration, and one task runs through its top-level agent with no model key. To pick between the tiers, see Testing tiers.

How do I run the built output instead of source?

Set the mode environment variable to lib, and build the project first with pnpm run build (Building and shipping Oda). Source mode is the default when the mode is unset.

Why does a source-mode launch refuse without a tsconfig?

Source mode resolves workspace imports through the path map of the TypeScript project you pass as tsconfigPath. Without it the launch stops with 'src' mode needs tsconfigPath for the workspace paths map.

Why is my entry path refused in built mode?

Built mode derives the built entry point by rewriting the last /src/ segment of the entry path (or the \src\ equivalent on Windows). A path with no such segment stops with expected a "/src/" segment or Windows equivalent in bin path <path>. Pass the built entry point explicitly (libBin) when your layout has no such segment.

Does a smoke run touch my working tree?

No. The child runs in a temporary folder the smoke test creates, with the fixture's home folders inside it. The smoke test removes only a folder it created; a folder you pass yourself is reused and left in place.

What happens when my fixture does not exit in time?

It is killed at its deadline, 30 seconds by default, and the run fails with did not exit within <s>s plus the captured output. The deadline ends the direct child only, so a process the fixture started can outlive the run.

Why did my run fail with an unexpected exit code?

The child ended with a code the run did not expect, in either direction: a nonzero exit where 0 was expected, or a clean exit where another code was declared. Declare expectedExitCode when the fixture is meant to end with a nonzero code. The message names both codes and attaches the captured output.

Why does the fixture turn complain about the number of agents?

The driver drives exactly one top-level agent. found 0 means no agent appeared, most often because the fixture registers no agents service; found <N> means the fixture published more than one. The driver waits for the first agent publication before counting, so a fixture that creates its agent late is fine.

What do I get back from a fixture turn?

The result envelope { type: 'result', sessionId, output, usage? }: the session id, the run's final output, and the usage collected per turn and step. usage is left out when the recorded stretch reports none.

Which environment does the fixture see?

Yours, with two changes: proxy settings are cleared, so a call to a fixture server is never sent through a proxy, and the fixture's home folders point inside its temporary folder. Standard input is closed at once.