Skip to content

feat(cloud-agent-next): add latest assistant message endpoint#2500

Open
kilo-code-bot[bot] wants to merge 4 commits intomainfrom
session/agent_e14e61a9-e87d-4cbc-ab14-573d2d64b369
Open

feat(cloud-agent-next): add latest assistant message endpoint#2500
kilo-code-bot[bot] wants to merge 4 commits intomainfrom
session/agent_e14e61a9-e87d-4cbc-ab14-573d2d64b369

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 16, 2026

Summary

  • Adds a protected getLatestAssistantMessage tRPC procedure for user-token access to a session's latest assistant response.
  • Queries the session Durable Object SQLite events for the latest root-session assistant message.updated by sortable message ID and returns its current parts.
  • Adds schema, RPC, unit, and integration coverage for ownership, missing sessions, no-message sessions, and child-session exclusion.

Verification

  • pnpm -w exec oxfmt services/cloud-agent-next/src services/cloud-agent-next/test
  • pnpm -w exec oxfmt --list-different services/cloud-agent-next/src services/cloud-agent-next/test
  • pnpm --filter cloud-agent-next exec vitest run src/router.test.ts
  • pnpm --filter cloud-agent-next run test:integration -- test/integration/session/events.test.ts
  • pnpm --filter cloud-agent-next run typecheck
  • pnpm --filter cloud-agent-next run lint
  • pnpm -w exec oxlint --config .oxlintrc.json services/cloud-agent-next/test/integration/session/events.test.ts

Visual Changes

N/A

Reviewer Notes

  • Latest assistant lookup requires metadata.kiloSessionId and filters message.updated rows to that root Kilo session; child/subagent assistant messages are intentionally excluded.
  • Verification emitted the existing Node engine warning because this environment uses Node v20.20.2 while the repo wants >=24 <25.

kilo-code-bot bot added 3 commits April 16, 2026 11:24
…d types

implement getLatestAssistantMessage in CloudAgentSession
expose via protected router procedure with GetLatestAssistantMessageInput/Output
implement DB query to fetch latest assistant message and its parts
define LatestAssistantMessage types and schemas
update tests and integration to cover retrieval
Comment thread services/cloud-agent-next/src/session/queries/events.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 16, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • services/cloud-agent-next/src/session/queries/events.ts
  • services/cloud-agent-next/test/integration/session/events.test.ts

Reviewed by gpt-5.4-20260305 · 800,909 tokens

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.

1 participant