Skip to content

Internal cleanup - #33821

Merged
Jinwoo-H merged 6 commits into
mainfrom
jinwoo/connector-cloud-hello-rev
Oct 26, 2026
Merged

Jinwoo-H merged 6 commits into
mainfrom
jinwoo/connector-cloud-hello-rev

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The connector now assigns hello revisions and returns them in successful hello responses. Polls, acknowledgments, and events with a non-current revision receive 409. Snapshot processing can update a pane from a newer turn ID. The connector contract defines payload limits, and event validation and request handling enforce size limits.

Priority: Normal

Merge Risk: Moderate · up to b335e

Valid oversized hellos may be rejected, and snapshot reconciliation may lose active prompts or incorrectly end conversations.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main changes: cloud-assigned hello revisions, rejection of stale requests, contract size caps, and snapshot turn IDs. It is specific and related to the changeset, alth…
Description check Passed The description is complete and follows the required structure. It explains the change, rationale, linked issue context, testing, visual proof, security notes, and checklist status. It also clearly st…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly identifies the main changes: cloud-assigned hello revisions, rejection of stale requests, contract size caps, and snapshot turn IDs. It is specific and related to the changeset, although it lists several related changes.

Full details: Description check

Explanation

The description is complete and follows the required structure. It explains the change, rationale, linked issue context, testing, visual proof, security notes, and checklist status. It also clearly states that manual testing was not performed.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5715f736-e29c-47a5-acae-114754fc6cbf
Commits

Reviewing files that changed from the base of the PR and between 5fea289 and b5fe32c.

Files selected for processing: 12
  • cloud/apps/connector/src/connector-events.test.ts
  • cloud/apps/connector/src/connector-hosts.ts
  • cloud/apps/connector/src/connector-inbox.test.ts
  • cloud/apps/connector/src/connector-server-harness.test-fixture.ts
  • cloud/apps/connector/src/connector-server.ts
  • cloud/apps/connector/src/connector-threads.ts
  • cloud/apps/connector/src/machine-routes.ts
  • cloud/packages/connector-contract/src/connector-endpoints.ts
  • cloud/packages/connector-contract/src/connector-limits.ts
  • cloud/packages/connector-contract/src/contract.test.ts
  • cloud/packages/connector-contract/src/event-messages.ts
  • cloud/packages/connector-contract/src/hello-messages.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@Jinwoo-H Jinwoo-H changed the title feat(connector): the cloud assigns hello revisions; byte caps and snapshot turn ids in the contract feat(connector): cloud-assigned hello revisions, stale requests refused with 409, contract size caps, snapshot turn ids Oct 26, 2026
This was referenced Oct 26, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2418949c-1f11-43a6-bb41-bcf149a6516d
Commits

Reviewing files that changed from the base of the PR and between b5fe32c and f8496d3.

Files selected for processing: 10
  • cloud/apps/connector/src/connector-events.test.ts
  • cloud/apps/connector/src/connector-hosts.ts
  • cloud/apps/connector/src/connector-inbox.test.ts
  • cloud/apps/connector/src/connector-threads.ts
  • cloud/apps/connector/src/machine-routes.ts
  • cloud/packages/connector-contract/src/connector-limits.ts
  • cloud/packages/connector-contract/src/contract.test.ts
  • cloud/packages/connector-contract/src/delivery-messages.ts
  • cloud/packages/connector-contract/src/event-messages.ts
  • cloud/packages/connector-contract/src/hello-messages.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

const entry = { conversation, paneKey: 'pane-1', agent: 'claude', turnId: 100 }
await events([{ conversation, paneKey: 'pane-1', kind: 'turn-started', at: 100 }])
await events([{ kind: 'snapshot', conversations: [{ ...entry, working: false, prompt }] }])
expect(await thread()).toMatchObject({ open_turn_id: 100, turn_state: 'unverifiable' })

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.

Major · Functional Correctness · Quick win

Normalize open_turn_id in this snapshot test too.

The database returns "100", so the numeric assertion at Line 224 fails in the reported pipeline run. Line 231 has the same mismatch and will fail when reached. Convert open_turn_id with Number(...) for these assertions. The earlier review comment at Line 211 identifies the same issue in the other snapshot test.

Proposed fix
-    expect(await thread()).toMatchObject({ open_turn_id: 100, turn_state: 'unverifiable' })
+    const unverifiable = await thread()
+    expect(Number(unverifiable?.open_turn_id)).toBe(100)
+    expect(unverifiable).toMatchObject({ turn_state: 'unverifiable' })
...
-    expect(await thread()).toMatchObject({ open_turn_id: 100, turn_state: 'ended' })
+    const ended = await thread()
+    expect(Number(ended?.open_turn_id)).toBe(100)
+    expect(ended).toMatchObject({ turn_state: 'ended' })

Also applies to: 231-231

🧰 Tools
🪛 GitHub Actions: Cloud Verify / 4_test.txt

[error] 224-224: The pnpm test pipeline failed in the connector test suite. In restores the same turn to working once a snapshot sees it working again, never an ended one, the assertion expected open_turn_id: 100 but received the string "100"; turn_state was also unverifiable.

🪛 GitHub Actions: Cloud Verify / test

[error] 224-224: The pnpm test step failed in the connector test suite. Test “restores the same turn to working once a snapshot sees it working again, never an ended one” expected open_turn_id: 100 but received the string "100"; the actual turn_state was unverifiable.

Source: Pipeline failures

if (event.kind === 'snapshot') {
// Not working never means done: an open turn the snapshot doesn't show working (or doesn't
// list; it lists every linked conversation) is unverifiable, and an unlisted one has no prompt.
// list; it lists recently active linked conversations) is unverifiable, and an unlisted one has no prompt.

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.

Major · Data Integrity & Integration · Heavy lift

Preserve prompts for conversations omitted by the snapshot limit.

If a host has 201 eligible conversations, the 200-entry cap omits at least one. Lines 71-79 then mark an omitted working thread unverifiable and clear its pending_prompt, even if that thread still has an approval awaiting an answer. Do not treat omission from a capped snapshot as evidence that the prompt is gone. Limit this cleanup to conversations the host explicitly reports as inactive, or run it only when the snapshot is complete.

maxSnapshotConversations: 200,
snapshotActiveWindowMs: 7 * 24 * 60 * 60 * 1000,
// A hello lists the most recently used projects, up to this many, and always fits maxRequestBytes.
maxHelloProjects: 500,

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.

Minor · Data Integrity & Integration · Quick win

Correct the hello size guarantee.

If 500 projects each have a 200-character name, remote, and label, those strings alone can exceed 256 KiB. The server will reject that hello with 413, despite the adjacent claim that the project cap always fits maxRequestBytes. State that the desktop must trim the serialized request by bytes; do not present maxHelloProjects as a size guarantee.

@Jinwoo-H Jinwoo-H mentioned this pull request Oct 26, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Require turnId for prompt-bearing snapshots. · connector-threads.ts:82-110

cloud/apps/connector/src/connector-threads.ts:82-110
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Require turnId for prompt-bearing snapshots.

A snapshot entry may omit turnId, but applyEvents still persists its pending_prompt and skips the turn-order update. A later accepted older turn-ended event can then clear the prompt and mark the conversation ended.

Require turnId when prompt is non-null before persisting the prompt. The server cannot distinguish an older end from the current turn without that identity.

This is independent of the capped-snapshot omission cleanup. The failure occurs for a listed conversation in the per-entry update.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d402b65c-3088-4b8d-b802-0c16e137749e
Commits

Reviewing files that changed from the base of the PR and between f8496d3 and b335ec6.

Files selected for processing: 1
  • cloud/apps/connector/src/connector-events.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

…d-hello-rev

# Conflicts:
#	cloud/apps/connector/src/connector-inbox.test.ts
@Jinwoo-H
Jinwoo-H merged commit 9aec987 into main Oct 26, 2026
27 checks passed
@Jinwoo-H Jinwoo-H changed the title feat(connector): cloud-assigned hello revisions, stale requests refused with 409, contract size caps, snapshot turn ids Internal cleanup Nov 4, 2026
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