fix(cursor-cli): preserve context across provider switches - #1241
fix(cursor-cli): preserve context across provider switches#1241hisjune wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/coding-agent/test/cursor-cli-oauth/session-router.test.ts">
<violation number="1" location="packages/coding-agent/test/cursor-cli-oauth/session-router.test.ts:432">
P2: The new `forceFreshChat` flag (cross-account failover fresh-chat guarantee) is not actually exercised here. `resumeMode: "off"` already disables resume and `contextRecapSuppressed: true` already disables the recap, so deleting `forceFreshChat` would not change the asserted `{ prompt, resumeChatId: undefined }` outcome. A regression in the failover path would pass. Add a focused case that leaves `resumeMode` at the default auto with a same-account bound chat, passes `forceFreshChat: true` plus `contextRecapRequested: true` with sensitive recentExchanges, and asserts `resumeChatId` stays undefined with no recap injected.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Addressed both Cubic findings in Verification:
|
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
|
Follow-up fixes are pushed in
Verification on the updated code and a local merge of current
Maintainer action needed: the fork PR workflows are currently |
There was a problem hiding this comment.
1 issue found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/coding-agent/CHANGELOG.md">
<violation number="1">
P2: This diff removes the only CHANGELOG entry that documented the PR's fix (preserving conversation context when a session switches into `cursor-cli-oauth`), and no replacement entry exists anywhere in the `## [Unreleased]` `### Fixed` section at HEAD. The PR still changes production behavior in `src/core/extensions/builtin/cursor-cli-oauth/session-router.ts`, so the changelog-gate requires a CHANGELOG.md entry for it; otherwise release notes omit the fix and the gate can fail. Restore the entry under Unreleased `### Fixed` (or add an equivalent entry) before merge.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
@cubic-dev-ai[bot] The gate observation is valid, but restoring this contributor-authored
The changelog workflow explicitly supports the policy-compatible alternative: Therefore the contributor diff should continue to omit |
@hisjune You're right, and I'll drop that suggestion. The gate observation stands — the changelog check will flag a PR without release-changelog coverage — but restoring a contributor-authored Since the PR already has the Tip: get faster answers by chatting with cubic’s review copilot in the review UI |
Summary
cursor-cli-oauthfrom another provider and prepend Senpi’s bounded recent-context recapCHANGELOG.mdedit; maintainer changelog policy remains intactContribution proposal: #1257
Root cause
The Cursor CLI session router generated recaps only for model changes inside an already-bound Cursor chat. A turn entering from another provider therefore sent only the latest user message, so Cursor behaved as if the conversation were new.
Two privacy boundaries also needed to be explicit rather than inferred:
undefinedrecap state conflated “no recap available” with “recap explicitly disabled,” so resume fallback could bypasscontextRecapOnProviderSwitch: false.Implementation
stream.tsdetects the provider transition, supplies bounded recent exchanges, and records the successful Cursor account name in a non-transcript assistant diagnostic.session-router.tscarries explicit fresh-chat recap authorization through fallback and acceptsnew | known | unknowncontext ownership.contextRecapOnProviderSwitch/SENPI_CURSOR_CLI_OAUTH_PROVIDER_RECAPremain independent from model-switch recap controls.Verification
TDD regressions
PRIVATE-OTHER-PROVIDER-CONTEXT; green after the fix with both attempts containing only the current promptbravoreceived prior Cursor/OpenAI recap text; green after the fix with a fresh, current-prompt-only turnAutomated
CI=1 bun run --cwd packages/coding-agent test test/cursor-cli-oauth— 27 files, 280 tests passedbun run check— passedbun run build— passedCI=1 npm run test— passed across all workspaces (supported contributor-compatible runner)upstream/mainlocally without history rewriting and repeated focused tests, check, build, and the canonical suite successfullyReal-surface QA
--help,--version, offline model listing, invalid input)Account isolation
Recap text is never persisted outside the ordinary Senpi transcript. Only the successful Cursor account name is stored as diagnostic metadata. Unknown ownership fails closed, replacement-account attempts receive neither recap text nor stale
--resume, and each account continues to use its own private HOME.