Skip to content

fix(chat): derive activity from agent_state#28

Open
emerson-gray wants to merge 3 commits intomainfrom
fix/chat-agent-activity
Open

fix(chat): derive activity from agent_state#28
emerson-gray wants to merge 3 commits intomainfrom
fix/chat-agent-activity

Conversation

@emerson-gray
Copy link
Copy Markdown
Contributor

Chat activity is now derived from agent activity, not just container lifecycle.

Behavior:

  • Running only when latest workload is status=RUNNING and agent_state=PROCESSING.
  • RUNNING + IDLE contributes Finished (but still returns active_workload_ids for subscriptions).
  • Backward compatibility: agent_state=UNSPECIFIED is treated as PROCESSING (older Runners).

Tests:

  • Updated GetChats test expectations.
  • Added TestGetChatsWorkloadRunningIdleReturnsFinished.

Depends on:

  • agynio/api PR #139
  • agynio/runners PR #47

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: please remove/avoid the UNSPECIFIED -> PROCESSING compatibility fallback for agent_state (see inline comment). It reintroduces legacy semantics and can mask missing agent_state; prefer treating UNSPECIFIED as unknown (or error) and relying on rollout order.

Comment thread internal/server/server.go
@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • Treat UNSPECIFIED workload agent state as unknown instead of defaulting to processing.
  • Remove deprecated participant_ids usage in tests/in-memory threads and align close error handling.
  • Guard in-process e2e cleanup against net.ErrClosed.

Testing

  • CHAT_E2E_INPROCESS=1 go test ./... (passed: all, failed: 0, skipped: 0)
  • golangci-lint run ./... (no issues)

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review: the UNSPECIFIED -> PROCESSING compatibility fallback has been removed; UNSPECIFIED now stays UNSPECIFIED and will not satisfy the RUNNING+PROCESSING gate. Looks aligned with the new agent_state semantics. (Minor: PR description still mentions the fallback; consider updating.)

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.

3 participants