Skip to content

refactor(cloud-agent): remove legacy runtime#3957

Draft
eshurakov wants to merge 1 commit into
mainfrom
sharp-porkpie
Draft

refactor(cloud-agent): remove legacy runtime#3957
eshurakov wants to merge 1 commit into
mainfrom
sharp-porkpie

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Remove the legacy Cloud Agent worker, web routers, clients, UI surfaces, workspace entries, CI jobs, and deployment configuration.
  • Make Code Review orchestration Cloud Agent Next-only while preserving cancellation, continuation, callback completion, and fresh-session recovery.
  • Preserve historical V1 session and review access through PostgreSQL/R2, including local deletion and read-only historical logs without runtime polling.

Verification

  • Not manually verified in the browser because no local development services were running.

Visual Changes

  • No screenshots. Nonterminal historical V1 code reviews now render persisted session logs with a Historical status instead of waiting for live events.

Reviewer Notes

  • This PR removes repository deployment inputs but does not delete deployed legacy Cloudflare resources; those must be decommissioned separately after rollout.
  • Historical PostgreSQL/R2 data and agent_version metadata are intentionally retained and never select a runtime backend.

await db
.update(cloud_agent_code_reviews)
.set({ agent_version: agentVersion })
.set({ agent_version: 'v2' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this mark a review as V2 even when an older code-review worker handles the preceding request? During a web-first rollout, omitting agentVersion makes that worker select V1, so streaming and cancellation can target the wrong backend.

return {
events: this.state.events || [],
};
await this.getCloudAgentNextClient().interruptSession(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if an already-running V1 Durable Object is cancelled during this rollout? Its persisted session ID belongs to the legacy worker, but this now always calls Cloud Agent Next, so the legacy run can keep posting after the review is marked cancelled.

Comment thread pnpm-lock.yaml
specifier: 'catalog:'
version: 4.98.0(@cloudflare/workers-types@4.20260605.1)(bufferutil@4.1.0)(utf-8-validate@6.0.6)

services/cloud-agent-next:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also remove event-source-polyfill from apps/web/package.json and regenerate the lockfile? Its only application import was in the deleted cloud-agent-client.ts, and knip now reports the dependency as unused.

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