Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

The native resume script: Stop's native control and the close's screen reading as the current APIs take them (#1058)

Deee67a030c86dd
diff --git a/cli/scripts/resume-native-e2e.ts b/cli/scripts/resume-native-e2e.ts
index b2ab71538..b1e174ad7 100644
--- a/cli/scripts/resume-native-e2e.ts
+++ b/cli/scripts/resume-native-e2e.ts
@@ -28,6 +28,12 @@ writeFileSync(join(bin, 'tmux'), `#!/bin/sh\nexec ${quote(tmuxBinary)} -L ${quot
for (const key of Object.keys(process.env)) {
if (/^(HARNESS|CODEX|CLAUDE|ANTHROPIC|OPENAI)_/.test(key) || key === 'CLAUDECODE') delete process.env[key]
}
+// A home of the fixture's own, for the tmux server and every shell and engine it starts. With the person's,
+// the shell a fixture pane keeps after its engine exits wrote the commands typed into it to their real
+// ~/.zsh_history (two `printf 'SURVIVING_SHELL_…'` lines per run, found 2026-10-08). macOS's /etc/zshrc puts
+// zsh's history in ${ZDOTDIR:-$HOME}, so both point here; HISTFILE covers a bash.
+const home = join(root, 'home'); mkdirSync(home)
+Object.assign(process.env, { HOME: home, ZDOTDIR: home, HISTFILE: join(home, '.shell_history') })
Object.assign(process.env, {
PATH: `${bin}:${process.env.PATH}`, ADAPTER_DATA_DIR: join(root, 'data'), ADAPTER_RUNTIME_DIR: join(root, 'runtime'),
ADAPTER_COMPUTER_ID_FILE: join(root, 'computer-id'), HARNESS_AUTH_DIR: join(root, 'auth'), DSH_DIR: join(root, 'dsh'),
@@ -57,6 +63,10 @@ const { startHookServer } = await import('../src/hookServer.js')
const { BackendSocket } = await import('../src/backendSocket.js')
const { bindNativeResumeRequests } = await import('../src/testing/nativeResumeSocket.js')
const { engineHooks } = await import('../src/engines/hooks.js')
+// The engines' screen readers and Codex's shared app-server control, composed in this process as the
+// daemon's inline mode does: the fixture runs no engine workers.
+const { readInlineScreen } = await import('../src/testing/inlineScreen.js')
+const { inlineNativeControls } = await import('../src/testing/inlineNativeControls.js')
const backend = new TmuxBackend()
const socketBackend = new BackendSocket('fixture-only')
const hooks: Array<{ engine: string; sessionId: string }> = []
@@ -156,6 +166,7 @@ try {
registry, stoppedAgents, restartJobs: jobs, stopJobs, tmuxBackend: backend,
agentReconciler: { suppress: () => {}, holdRoute: () => {}, releaseRoute: () => {}, trigger: async () => {} },
forgetSession: id => { registry.removeAgent(id); socketBackend.send({ type: 'agent_deleted', payload: { agentId: id, retained: true } }) }, markDeleted: () => {}, clearDeleted: () => {},
+ stopNative: inlineNativeControls().stop,
})
socketBackend.closeAgentService?.dispose()
socketBackend.closeAgentService = new CloseAgentService({
@@ -173,7 +184,7 @@ try {
for (const line of raw) lineToEvents(line, state)
if (raw.length) turnOpen = state.turnOpen
}
- return inspectCloseActivity(row, screen, turnOpen, false)
+ return inspectCloseActivity(row, await readInlineScreen(row, screen), turnOpen, false)
},
checkpoint: async (row, phase) => sessionCheckpoints.save(row, {
screen: phase === 'before' ? await tmux('capture-pane', '-p', '-S', '-2000', '-t', row.tmuxPane) : null,