fix(agent): report most-recent session id and status from getAgentStatus#60
Open
devYRPauli wants to merge 1 commit into
Open
fix(agent): report most-recent session id and status from getAgentStatus#60devYRPauli wants to merge 1 commit into
devYRPauli wants to merge 1 commit into
Conversation
getAgentStatus collapsed all sessions into a running/offline flag and never populated AgentStatusInfo.sessionId, despite sessionId being a declared field on the type and the function being exposed as window.getAgentStatus. Report the most-recently-active session's id and a mapped status (active states -> running, completed/cancelled/error preserved) so callers can tell which session the status refers to. No sessions still yields offline.
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.
Problem
getAgentStatus()returned only arunning/offlineflag and never populatedAgentStatusInfo.sessionId, even thoughsessionIdis a declared field on the type andgetAgentStatusis exposed aswindow.getAgentStatus. Callers could not tell which session the status referred to, and a completed session reportedofflinerather thancompleted.Fix
Report the most-recently-active session (by
lastActivity): return itsidassessionId, itsstartTimeasstartedAt, and a mapped status (active states ->running;completed/cancelled/errorpreserved;interrupted->error). With no sessions it still returnsoffline.Test
src/tests/agent-status.test.tsnow passes (prefers the most-recent completed session, and the most-recent running session).