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:
@@ -1927,7 +1927,12 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
|
||||
const effectiveCwd = worktree ?? cwd;
|
||||
const sessionManager = sessionFile
|
||||
? await awaitAbortable(SessionManager.open(sessionFile, undefined, undefined, { initialCwd: effectiveCwd }))
|
||||
? await awaitAbortable(
|
||||
SessionManager.open(sessionFile, undefined, undefined, {
|
||||
initialCwd: effectiveCwd,
|
||||
suppressBreadcrumb: true,
|
||||
}),
|
||||
)
|
||||
: SessionManager.inMemory(effectiveCwd);
|
||||
if (options.parentArtifactManager) {
|
||||
sessionManager.adoptArtifactManager(options.parentArtifactManager);
|
||||
@@ -2048,7 +2053,9 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
// (createAgentSession → agent.replaceMessages). Isolated runs are not
|
||||
// resumable (worktree is merged + cleaned) and never get a reviver.
|
||||
reviveSession = async () => {
|
||||
const reopened = await SessionManager.open(sessionFile);
|
||||
const reopened = await SessionManager.open(sessionFile, undefined, undefined, {
|
||||
suppressBreadcrumb: true,
|
||||
});
|
||||
if (options.parentArtifactManager) {
|
||||
reopened.adoptArtifactManager(options.parentArtifactManager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user