fix(coding-agent/session): suppressed subagent breadcrumbs so --continue resumes the parent session

- Added a `suppressBreadcrumb` option to `SessionManager.open()` so headless opens skip writing the per-TTY `--continue` breadcrumb, and passed it from the subagent opens in `task/executor.ts` and the HTML export open in `export/html/index.ts`, which run in the parent's terminal and were clobbering the breadcrumb with their own artifact-dir session file.
- Added `resolveBreadcrumbToInteractiveRoot()` and applied it in `continueRecent()` so already-poisoned breadcrumbs pointing inside a parent's artifacts dir (`<parent>/<agentId>.jsonl`) resolve back up to the top-level interactive session.
- Added `subagent-breadcrumb.test.ts` covering both that a subagent open keeps `--continue` on the parent and that a stale subagent-pointing breadcrumb is recovered.
This commit is contained in:
can1357
2026-06-16 16:05:50 +02:00
parent 623e9d3710
commit 6bbc573c6f
4 changed files with 155 additions and 4 deletions
@@ -242,7 +242,7 @@ export async function exportFromFile(inputPath: string, options?: ExportOptions
let sm: SessionManager;
try {
sm = await SessionManager.open(inputPath);
sm = await SessionManager.open(inputPath, undefined, undefined, { suppressBreadcrumb: true });
} catch (err) {
if (isEnoent(err)) throw new Error(`File not found: ${inputPath}`);
throw err;