Repository navigation
Link forked skills to their Skill call and finish them - #39
Merged
Merged
Conversation
5 tasks
Contributor
Author
|
CI's check failed on |
Contributor
Author
|
The next run timed out in two more of #37's tests, the move and progress ones: their slow mode paused after every 4 KB chunk, about 600 pauses, and the runner only got halfway through the 2.4 MB fixture in 20 s ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A skill run with
context: forkshowed up as a sub-agent of the session's root instead of theSkillcall that started it. On Claude Code 2.1.317 through 2.1.323 it also never finished, so its lane stayed open and its status stuck: one readthinkingan hour after its call returned. The fork's meta names no call, and antfarm only linked sub-agents through a meta'stoolUseIdor an asyncAgentresult.The
Skillresult names the fork (status: "forked",agentId), so antfarm now links the fork to the call and the calling agent there. A foreground fork, which is what 2.1.323 and earlier write, is finished at that result. While one runs, its meta is linked to the session's one openSkillcall that has no fork yet and started before the fork's transcript was written, and the result confirms or replaces that link.leaf_agentnow follows any open call with a live linked child, so a running fork's permission prompt is shown on the fork's own call rather than on the root'sSkillcall. Backfill batches carry fork links too, so forks older than the 16 MB tail are fixed as well.A live repro turned up a change in 2.1.325: the
Skillresult now hasbackground: trueand returns at once, and the fork finishes later throughfinished: truein its meta and a task notification. Across 91 forked results from 2.1.317 to 2.1.323 none hadbackground, and the 2.1.325 one did. Background forks are linked at the result and finish on their own, like an asyncAgent.Done when
a_forked_result_links_and_finishes_its_forkinsubagents.rs. Background forks:a_background_fork_is_linked_at_its_result_and_finished_by_its_notification.a_running_fork_is_linked_to_the_open_skill_call_and_is_the_leaf(one spawn mark after the result),with_two_open_skill_calls_the_fork_waits_for_its_result, anda_wrong_running_link_is_replaced_by_the_result.a_workflow_agent_or_an_old_fork_is_not_taken_for_a_running_forkcovers metas that must not match: workflow agents, and old forks read at attach.a_fork_started_by_a_sub_agent_goes_under_it.real_forked_skillincrates/antfarm-core/tests/fixtures.rs, onfixtures/real/forked-skillcaptured withcapture-fixturefrom a throwaway Haiku session with a scratchcontext: forkskill. It isn't from a real project. It sits with the other fixture tests instead of insubagents.rs, and the unit tests there cover the foreground path, which 2.1.325 no longer writes. The scrubber was renaming thebackgroundkey insidetoolUseResult; it's now kept, with a test.forked-skill.jsonandforked-skill.marker.jsonfiles, which antfarm doesn't read.Backfill:
a_backfilled_fork_link_links_and_finishes_itand the decoder'sa_forked_skill_result_becomes_a_fork_link.Checked by hand
live-reproon Claude Code 2.1.325 with Haiku, main against the branch, running a forked scratch skill that sleeps 12 seconds. While it ran, main showed the fork under the root with nospawned_by, and the branch showed it under theSkillcall. After it finished, both marked it finished at the same time, from the meta and the notification, and only the branch had it linked. The app's recorded screens are unchanged when regenerated.Not checked
a_running_fork_is_linked_to_the_open_skill_call_and_is_the_leaf.Closes #36