Skip to content

fix: use completed history for forked subagents - #30

Merged
K-Mistele merged 2 commits into
mainfrom
debug-fork-mode-tool-output-race-condition
Aug 30, 2026
Merged

fix: use completed history for forked subagents#30
K-Mistele merged 2 commits into
mainfrom
debug-fork-mode-tool-output-race-condition

Conversation

@K-Mistele

Copy link
Copy Markdown
Contributor

Summary

  • make public fork: true subagents persist the completed-history selector
  • apply the same safe default to legacy fork records when they are projected or resumed
  • cover both paths so child requests omit the unresolved parent tool call that launched them

Why

A fork starts before its parent subagent tool call can have a result. Including that parent call in the child request sends OpenAI a function call with no output, which it rejects.

Validation

  • bun --bun x vitest run packages/fold-core/test/Subagents/SubagentFork.vi.test.ts packages/fold-core/test/Subagents/SubagentToolWire.vi.test.ts packages/fold-core/test/Projection/Projection.vi.test.ts
  • bun --bun --cwd packages/fold-core test
  • bun --bun run typecheck --filter @humanlayer/fold-core
  • bun --bun run format:check
  • bun --bun run lint (0 errors; existing warnings only)

No changeset: this repository has no .changeset configuration and the directly modified @humanlayer/fold-core package is private.

@K-Mistele
K-Mistele merged commit c007577 into main Aug 30, 2026
5 checks passed
@K-Mistele
K-Mistele deleted the debug-fork-mode-tool-output-race-condition branch August 30, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant