refactor(agent-core-v2): drop the unused AgentPhase status union - #3760
Open
sailist wants to merge 1 commit into
Open
refactor(agent-core-v2): drop the unused AgentPhase status union#3760sailist wants to merge 1 commit into
sailist wants to merge 1 commit into
Conversation
|
commit: |
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
None — internal cleanup (dead type removal).
Problem
AgentPhase(a 7-kind union: idle/running/tool_call/retrying/awaiting_approval/interrupted/ended) was declared inagent-core-v2as the wire shape ofagent.status.updated, but nothing ever produced or consumed it: everyAgentStatusUpdatedemission omitsphase, and the single consumer of the event interface never reads it. Three of its kinds (awaiting_approval,interrupted,ended) are not agent-machine states at all — they are echoes of turn domain events and the permission interaction system. The authoritative agent state set is the xstate machine projection (LoopSnapshot.stateidle/running +MachineEngineTurnSnapshot.phaserunning/tool_call/retrying), which flows to clients via theagent.statemessage and is unaffected by this declaration.The klient contract also declared
phase: z.string().optional()foragent.status.updated— never populated and wrongly typed (the declaredAgentPhasewas an object, not a string).What changed
AgentPhaseunion and thephasefield fromAgentStatusUpdatedEventinpackages/agent-core-v2/src/agent/usage/usageEvents.ts(plus the now-unusedTurnEndReasonimport).phasefield from theagent.status.updatedschema inpackages/klient/src/contract/agent/events.ts.apps/kimi-inspect/src/panels.ts: the AgentLoopService panel fetchedactivitySnapshot, which does not exist onIAgentLoopService; it now fetchessnapshot().No behavior change:
agent.statewireturn.status,LoopSnapshot.turn.phase, and all durable turn events are untouched. Phase is derived live from the machine and never persisted, so there is no migration surface.Checklist
/approve). — N/A, internal cleanup, no issue.gen-changesetsskill, or this PR needs no changeset. — No changeset: not user-perceivable.gen-docsskill, or this PR needs no doc update. — No doc update needed.