refactor(agent-core-v2): align xstate machine naming with command/fact/streaming conventions - #3635
Merged
sailist merged 1 commit intoSep 8, 2026
Conversation
…t/streaming conventions
|
commit: |
5 tasks
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.
Related Issue
N/A — internal refactor, no user-facing change.
Problem
The XState machines in agent-core-v2 had drifted from the naming conventions we adopted (XState official guidance + messaging convention: commands imperative, events past tense): noun/past-participle command events (
turn.notifications,input.reminder), mixed segment casing (llm.message-idkebab,turn.spawnTools/turn.remindersConsumedcamel), preposition state names (before/afterin the tool machine), and no visible distinction for streaming data events (llm.delta/headers/usage/finish/message-id).What changed
Pure renames, no behavior change; wire contracts (klient / kap-server / bus event names) are untouched.
docs/en/event-name.mdanddocs/zh/event-name.mdunderpackages/agent-core-v2/docs/.turn.notifications→turn.notify,input.reminder→input.remind,turn.spawnTools→turn.spawn_tools.turn.remindersConsumed→turn.reminders_consumed,turn.start→turn.started(matches the bus event name),agent.error→agent.failed,tool.async→tool.detached.llm.delta→llm.streaming.part,llm.headers→llm.streaming.headers,llm.usage→llm.streaming.usage,llm.finish→llm.streaming.finish,llm.message-id→llm.streaming.message_id. The five identical streaming handlers in the agent and session machines each collapse into one'llm.streaming.*'wildcard declaration.before/after→preparing/finishing(invoke actors renamed topreparingActor/finishingActoraccordingly).LlmRequestEventis a public subpath export) and the shorthand event lists indocs/{en,zh}/llm.md.providerCatalog's naming deviations are deliberately excluded: PR #3606 is rewiring that file, its rename will follow after that lands.
Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.