Skip to content

refactor(cloud-agent-next): consolidate creation ownership - #5967

Open
eshurakov wants to merge 2 commits into
mainfrom
eshurakov/cozy-rapids
Open

refactor(cloud-agent-next): consolidate creation ownership#5967
eshurakov wants to merge 2 commits into
mainfrom
eshurakov/cozy-rapids

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Consolidate duplicated cloud-agent-next clones at their existing owners: unique message-event insertion/broadcast, the six legacy-compatible profile fields, restore command execution/token cleanup, stored turn schema, worker-wrapper Kilo event session-ID parsing, and assistant error recognition with distinct raw/safe fallbacks.
  • Add session-creation-preflight.ts as the single request-scoped owner for organization membership, repository access, profile resolution, mode validation, endpoint validation, and prompt-only model validation. Start and prepare pass its resolved request to registration.
  • Preserve prompt/command/clone-only model behavior, prepare-only command/devcontainer validation, fresh HTTP preflight before repeated operation-ledger replay, and internal registration retry boundaries.
  • Add pinned jscpd@5.0.16 production scanning with fingerprinted, bounded exceptions, plus TypeScript architecture checks for preflight ownership and bypasses. Both checks and their fixtures run in the cloud-agent CI job.

Verification

  • pnpm --filter cloud-agent-next run typecheck
  • pnpm --filter cloud-agent-next run lint — 0 warnings/errors
  • pnpm --filter cloud-agent-next run format:check
  • pnpm --filter cloud-agent-next run test:checkers — 32 tests
  • pnpm --filter cloud-agent-next run check:architecture
  • pnpm --filter cloud-agent-next run check:duplication — 2 bounded exceptions, no new duplication
  • node --test scripts/changes-filter-retry.test.mjs — 7 tests
  • pnpm --filter cloud-agent-next test:all — unit 5,792 passed / 3 skipped; Worker integration 627 passed; wrapper 1,192 passed
  • Browser E2E against the real local stack created session ses_f7f6f9f00fffJ07y555Z0OMpxY and showed the prompt plus Environment prepared without creation/auth/model/repository errors

Unit/integration tests still mock some PostgreSQL, model HTTP, Durable Object, sandbox, and process boundaries. Browser E2E is the real user-visible start-path proof. No deployment was attempted.

@kilo-code-bot

kilo-code-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • .github/workflows/ci.yml
  • services/cloud-agent-next/AGENTS.md
  • services/cloud-agent-next/package.json
  • services/cloud-agent-next/scripts/check-architecture.test.ts
  • services/cloud-agent-next/scripts/check-architecture.ts
Previous Review Summary (commit ea4e7a6)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit ea4e7a6)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (31 files)
  • .github/workflows/ci.yml
  • pnpm-lock.yaml
  • services/cloud-agent-next/AGENTS.md
  • services/cloud-agent-next/package.json
  • services/cloud-agent-next/scripts/check-architecture.test.ts
  • services/cloud-agent-next/scripts/check-architecture.ts
  • services/cloud-agent-next/scripts/check-duplication.test.ts
  • services/cloud-agent-next/scripts/check-duplication.ts
  • services/cloud-agent-next/scripts/duplication-allowlist.json
  • services/cloud-agent-next/src/persistence/CloudAgentSession.ts
  • services/cloud-agent-next/src/persistence/schemas.test.ts
  • services/cloud-agent-next/src/persistence/schemas.ts
  • services/cloud-agent-next/src/router/handlers/session-creation-preflight.test.ts
  • services/cloud-agent-next/src/router/handlers/session-creation-preflight.ts
  • services/cloud-agent-next/src/router/handlers/session-prepare.test.ts
  • services/cloud-agent-next/src/router/handlers/session-prepare.ts
  • services/cloud-agent-next/src/router/handlers/session-start.ts
  • services/cloud-agent-next/src/sandbox-session/control-plane-ingest.ts
  • services/cloud-agent-next/src/session-prepare.test.ts
  • services/cloud-agent-next/src/session-service.test.ts
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session/safe-failure-projection.test.ts
  • services/cloud-agent-next/src/session/session-message-state.test.ts
  • services/cloud-agent-next/src/session/session-message-state.ts
  • services/cloud-agent-next/src/session/wrapper-supervisor.ts
  • services/cloud-agent-next/src/shared/assistant-failure.ts
  • services/cloud-agent-next/src/shared/kilo-event.ts
  • services/cloud-agent-next/src/websocket/ingest.ts
  • services/cloud-agent-next/test/integration/session/message-terminalization.test.ts
  • services/cloud-agent-next/test/integration/session/pending-messages.test.ts
  • services/cloud-agent-next/wrapper/src/control/feed.ts

Reviewed by grok-4.6 · Input: 69K · Output: 5.8K · Cached: 204.7K

Review guidance: REVIEW.md from base branch main

Drop the handler-shape AST check. Keep the duplication ratchet.
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