Skip to content

fix(runtime-fallback): reland BLOCKER-4 delegated empty-history fallback (#4059)#4136

Merged
code-yeongyu merged 4 commits into
devfrom
fix/4059-blocker4-reland
May 18, 2026
Merged

fix(runtime-fallback): reland BLOCKER-4 delegated empty-history fallback (#4059)#4136
code-yeongyu merged 4 commits into
devfrom
fix/4059-blocker4-reland

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Relands BLOCKER-4 (delegated child-session empty-history fallback) reverted in #4044.
When a delegated child session fails on its first promptAsync call before history persists, runtime-fallback consumes the captured bootstrap retry parts (system + tools preserved) and clears the bootstrap entry to prevent double-consumption.

Why this reland sticks (vs PR #3825)

PR #3825's regression test was non-deterministic against post-#4032 schema changes and rotated logger state shared across tests. This version keeps the fix narrow:

Changes

  • src/hooks/runtime-fallback/last-user-retry-parts.ts: when persisted history is empty and a bootstrap exists, return its retryParts and clearDelegatedChildSessionBootstrap(sessionID) to prevent reuse on subsequent retries.
  • src/hooks/runtime-fallback/index.test.ts: add assertion that bootstrap is cleared after consumption.
  • src/shared/logger.test.ts: per-test cache-busting dynamic import of ./logger so rotation state cannot leak across tests in the shared root suite.
  • CHANGELOG.md: add v4.2.1 entry.
  • docs/reference/known-issues.md: mark BLOCKER-4 RESOLVED in v4.2.1.

Testing

  • bun test src/hooks/runtime-fallback/index.test.ts --timeout 30000 ✅ (63 pass / 0 fail)
  • bun test src/shared/logger.test.ts --timeout 30000 ✅ (7 pass / 0 fail)
  • Killer gate (the one that broke PR fix(delegate-task): harden child-session first-prompt fallback recovery #3825): bun test --timeout 30000 ✅ (7072 pass / 1 skip / 0 fail / 7073 across 729 files)
  • bun run typecheck ✅ (clean)
  • bun run build ✅ (clean)

Related Issues


Summary by cubic

Fixes BLOCKER-4 by making delegated child-session fallback work when the first prompt fails before history persists. On retry, we consume the captured bootstrap once, preserve system + tools, and clear the bootstrap immediately to prevent reuse.

  • Bug Fixes
    • When history is empty, consume the delegated bootstrap retry payload once and clear it right away.
    • Added an explicit test asserting the bootstrap is undefined after consumption.
    • Isolated src/shared/logger.test.ts via per-test dynamic imports to stop rotation state leaks.
    • Updated CHANGELOG.md and marked BLOCKER-4 resolved in v4.2.1 docs.

Written for commit 971be27. Summary will update on new commits. Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: The PR appears well-tested and narrowly scoped, but the custom criterion requires 100% certainty of no regressions, which is impossible to guarantee from code review alone, especially for a reland of previously reverted functionality.
Re-trigger cubic

code-yeongyu and others added 4 commits May 18, 2026 13:42
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@code-yeongyu code-yeongyu force-pushed the fix/4059-blocker4-reland branch from c33964b to 971be27 Compare May 18, 2026 04:44
@code-yeongyu

Copy link
Copy Markdown
Owner Author

Branch rebased on dev to resolve CHANGELOG conflict. Requesting Cubic re-review of new HEAD 971be27.

@code-yeongyu code-yeongyu merged commit b0f432d into dev May 18, 2026
9 checks passed
@code-yeongyu code-yeongyu deleted the fix/4059-blocker4-reland branch May 18, 2026 04:50
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.

delegate-task child-session fallback can stop before empty-history retry

1 participant