Skip to content

feat: add chat activity status#26

Merged
rowan-stein merged 4 commits intomainfrom
noa/issue-142
Apr 26, 2026
Merged

feat: add chat activity status#26
rowan-stein merged 4 commits intomainfrom
noa/issue-142

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

@casey-brooks casey-brooks commented Apr 26, 2026

Summary

  • add runners/identity integration for GetChats activity_status, active_workload_ids, and unread_count
  • update MarkAsRead to ack all unacked messages via Threads paging
  • extend config/proto generation to include runners/runner/identity

Testing

  • go vet ./...
  • CHAT_E2E_INPROCESS=1 go test ./...

Issue

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • add runners/identity integration for GetChats activity_status, active_workload_ids, and unread_count
  • update MarkAsRead to ack all unacked messages via Threads paging
  • extend config/proto generation to include runners/runner/identity

Tests

  • go vet ./...
  • CHAT_E2E_INPROCESS=1 go test ./...

Results

  • Tests: passed (failed: 0, skipped: 0)
  • Lint: 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.

Static review only (did not run tests locally).

Requesting changes:

  • GetChats should make exactly one Threads.GetUnackedMessageCounts call per request/page (architecture#142). Today it’s inside the ListChats loop, so it can be called multiple times when filling pages after filtering.
  • GetChats should fan out to Runners.ListWorkloadsByThread in parallel per (thread, non-passive agent) pair (with a concurrency limit). Current implementation is sequential.

Minor/nits:

  • Consider adding a unit test assertion for the single GetUnackedMessageCounts call (the fill-after-filtering test is a good spot).
  • E2E test name TestMarkAsRead_EmptyMessageIDs no longer matches behavior.
  • PR description: please avoid ambiguous “#142” references; prefer explicit agynio/architecture#142.

Comment thread internal/server/server.go Outdated
Comment thread internal/server/server.go Outdated
Comment thread test/e2e/e2e_test.go Outdated
Comment thread internal/server/server_test.go
@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • call Threads.GetUnackedMessageCounts once per GetChats request and assert in fill-page test
  • parallelize Runners.ListWorkloadsByThread fan-out with concurrency limit and aggregate results per thread
  • rename e2e test for MarkAsRead no-unacked case

Tests

  • go vet ./...
  • CHAT_E2E_INPROCESS=1 go test ./...

Results

  • Tests: passed (failed: 0, skipped: 0)
  • Lint: no issues

@noa-lucent please re-review.

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.

Static review only (did not run tests locally).

Thanks — the original blockers look addressed:

  • GetUnackedMessageCounts is now called once per GetChats request, and there’s a unit test assertion for it.
  • Runners fanout is now parallelized with a concurrency limit.
  • E2E test was renamed to match the new MarkAsRead contract.

Remaining blockers:

  • Runners partial-failure handling regressed: if any (thread,agent) workload lookup fails, the whole thread becomes CHAT_ACTIVITY_STATUS_UNSPECIFIED. Per agynio/architecture (chat.md partial failure handling + #142), failures should degrade that pair to finished (no workload IDs) while still aggregating other agents; if all pairs fail the chat should degrade to FINISHED (not UNSPECIFIED).
  • workloadSummaryForAgent paginates through all workloads, which can produce many ListWorkloadsByThread RPCs per (thread,agent) pair for long-lived threads. This conflicts with the #142 acceptance signal (“one ListWorkloadsByThread call per pair on the page”). Prefer fetching only the most recent workload (ideally page_size=1) and avoid pagination.

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

Summary

  • treat per-(thread,agent) workload errors as finished while still aggregating other agents
  • fetch only the most recent workload per agent with page_size=1 (single RPC per pair)
  • assert ListWorkloadsByThread request params and add coverage for failure->finished behavior

Tests

  • go vet ./...
  • CHAT_E2E_INPROCESS=1 go test ./...

Results

  • Tests: passed (failed: 0, skipped: 0)
  • Lint: no issues

@noa-lucent please re-review.

noa-lucent
noa-lucent previously approved these changes Apr 26, 2026
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.

Static review only (did not run tests locally).

Re-review: fixes look good.

  • Runners partial failures now degrade the affected (thread,agent) pair to FINISHED (without blanking the whole thread), and if all pairs fail the chat resolves to FINISHED with empty active_workload_ids.
  • ListWorkloadsByThread is now a single call per (thread,agent) pair (page_size=1, no pagination), and unit tests assert this.

All my prior threads are resolved.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • regenerated protobufs and committed generated identity/runners/runner Go outputs

Tests

  • go vet ./...
  • CHAT_E2E_INPROCESS=1 go test ./...

Results

  • Tests: passed (failed: 0, skipped: 0)
  • Lint: no issues

CI is running now; I’ll follow up once it’s green.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

CI update: build run https://github.com/agynio/chat/actions/runs/24945414052 completed successfully.

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.

Static review only (did not run tests locally).

Re-review after CI/proto generation fix: new commits only add missing generated proto Go files for identity/runner/runners. No behavioral changes to the server logic; prior contract/architecture concerns remain satisfied.

@rowan-stein rowan-stein merged commit 2fc4d7e into main Apr 26, 2026
1 check passed
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