Skip to content

AppBuilder - Tag sessions with app-builder platform identifier#192

Open
eshurakov wants to merge 1 commit intomainfrom
eshurakov/app-builder-session-tag
Open

AppBuilder - Tag sessions with app-builder platform identifier#192
eshurakov wants to merge 1 commit intomainfrom
eshurakov/app-builder-session-tag

Conversation

@eshurakov
Copy link
Contributor

Summary

  • Thread createdOnPlatform through the prepareSession flow so App Builder sessions are tagged as 'app-builder' instead of the hardcoded 'cloud-agent' default.
  • Add 'app-builder' to KNOWN_PLATFORMS for filtering in the CLI sessions list.

Changes

  • cloud-agent/src/router/schemas.ts: Add createdOnPlatform to PrepareSessionInput schema (optional string, max 100 chars).
  • cloud-agent/src/persistence/schemas.ts: Add createdOnPlatform to MetadataSchema.
  • cloud-agent/src/persistence/CloudAgentSession.ts: Add createdOnPlatform to prepare() input type.
  • cloud-agent/src/session-service.ts: Accept createdOnPlatform in createKiloSessionInBackend(), defaulting to 'cloud-agent'.
  • cloud-agent/src/router/handlers/session-prepare.ts: Pass createdOnPlatform to both backend session creation and DO preparation.
  • cloud-agent/src/router/handlers/session-init.ts: Forward createdOnPlatform from metadata into session init options.
  • src/lib/cloud-agent/cloud-agent-client.ts: Add createdOnPlatform to client-side PrepareSessionInput type.
  • src/lib/app-builder/app-builder-service.ts: Set createdOnPlatform: 'app-builder' in both createProject and sendMessage flows.
  • src/routers/cli-sessions-router.ts: Add 'app-builder' to KNOWN_PLATFORMS.

Thread createdOnPlatform through the prepareSession flow so sessions
created by App Builder are tagged as 'app-builder' instead of the
default 'cloud-agent'. Add 'app-builder' to KNOWN_PLATFORMS for
filtering in the CLI sessions list.
})
.optional(),
upstreamBranch: branchNameSchema.optional(),
createdOnPlatform: z.string().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Add a max length to createdOnPlatform in MetadataSchema

PrepareSessionInput caps this at 100 chars, but DO metadata currently accepts an unbounded string. Keeping these aligned helps prevent oversized metadata and makes validation consistent.

Suggested change
createdOnPlatform: z.string().optional(),
createdOnPlatform: z.string().max(100).optional(),

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 13, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1

Fix these issues in Kilo Cloud

Issue Details (click to expand)

SUGGESTION

File Line Issue
cloud-agent/src/persistence/schemas.ts 163 Align createdOnPlatform validation with API schema (add max length)
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
N/A N/A None
Files Reviewed (9 files)
  • cloud-agent/src/persistence/CloudAgentSession.ts - 0 issues
  • cloud-agent/src/persistence/schemas.ts - 1 issue
  • cloud-agent/src/router/handlers/session-init.ts - 0 issues
  • cloud-agent/src/router/handlers/session-prepare.ts - 0 issues
  • cloud-agent/src/router/schemas.ts - 0 issues
  • cloud-agent/src/session-service.ts - 0 issues
  • src/lib/app-builder/app-builder-service.ts - 0 issues
  • src/lib/cloud-agent/cloud-agent-client.ts - 0 issues
  • src/routers/cli-sessions-router.ts - 0 issues

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