Skip to content

feat(cloud-agent-next): add exact message result polling#3667

Merged
eshurakov merged 1 commit into
mainfrom
vivid-thorium
Jun 2, 2026
Merged

feat(cloud-agent-next): add exact message result polling#3667
eshurakov merged 1 commit into
mainfrom
vivid-thorium

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

@eshurakov eshurakov commented Jun 2, 2026

Summary

  • Add a bearer-protected getMessageResult tRPC query so asynchronous CLI clients can poll one submitted Cloud Agent turn by exact messageId.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Jun 2, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The getMessageResult tRPC query is well-implemented with thorough ownership isolation, strict output schema allowlisting, and comprehensive test coverage at both unit and integration levels.

Files Reviewed (11 files)
  • services/cloud-agent-next/README.md
  • services/cloud-agent-next/src/persistence/CloudAgentSession.ts
  • services/cloud-agent-next/src/router.test.ts
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/router/schemas.test.ts
  • services/cloud-agent-next/src/router/schemas.ts
  • services/cloud-agent-next/src/session/message-result.test.ts
  • services/cloud-agent-next/src/session/message-result.ts
  • services/cloud-agent-next/src/session/queries/events.ts
  • services/cloud-agent-next/src/session/session-message-state.ts
  • services/cloud-agent-next/test/integration/session/message-result.test.ts

Notable design decisions verified:

  • getAssistantMessageById SQL uses LIMIT 1 without ORDER BY — safe because entity_id is declared UNIQUE in the events table schema, guaranteeing at most one matching row.
  • requireSessionId() is called after storage reads in getMessageResult, but cannot throw: metadata presence at line 988 guarantees identity.sessionId exists (required field in CurrentSessionMetadataSchema).
  • running status (mapped from internal accepted) correctly allows acceptedAt but blocks terminalAt, completionSource, failure, gateResult, and assistant through the superRefine constraints.
  • The AssertTrue compile-time guard in session-message-state.ts ensures the public SessionMessageFailureStage/SessionMessageFailureCode enums stay in sync with CloudAgentRunStateReport at the type level.
  • Pending-only compatibility fallback uses a full prefix scan (storage.list()), which is an existing pre-PR pattern, not a new performance concern.

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 3,830,315 tokens

Review guidance: REVIEW.md from base branch main

@eshurakov eshurakov merged commit c21ae68 into main Jun 2, 2026
14 checks passed
@eshurakov eshurakov deleted the vivid-thorium branch June 2, 2026 18:44
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.

2 participants