Skip to content

fix(core): skip skill context when locating invoking turns - #68

Merged
K-Mistele merged 1 commit into
mainfrom
fix-skill-fork-boundaries
Aug 15, 2026
Merged

fix(core): skip skill context when locating invoking turns#68
K-Mistele merged 1 commit into
mainfrom
fix-skill-fork-boundaries

Conversation

@K-Mistele

@K-Mistele K-Mistele commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve AgentLayer's existing fork policy: remove the parent turn that invoked the fork, then append the delegated child task
  • when locating that parent turn, skip injected <skill ...>...</skill> user-role messages and continue backward to the actual human message
  • use the same distinction for counting fork_turns: N
  • add a regression test matching the production skill-injection message shape

Design Note

This does not copy native Codex's full-history fork algorithm. Codex full-history forks do not remove the invoking turn; they filter the complete rollout by item type. This change only adopts Codex's useful distinction between real human messages and injected skill context inside AgentLayer's existing turn-removal behavior.

Verification

  • bun check

@github-actions

Copy link
Copy Markdown

Docs Agent Review

Agent finished with reason: error


To apply these recommendations, comment: @docs-agent apply

@K-Mistele K-Mistele changed the title fix(core): distinguish skill context from user turns fix(core): skip skill context when locating invoking turns Aug 14, 2026
@K-Mistele
K-Mistele merged commit 4cb4e7b into main Aug 15, 2026
7 checks passed
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