Skip to content

fix: clarify Cursor metadata and session affinity - #22

Merged
yansigit merged 265 commits into
devfrom
codex/fix-web-search-sidecar-backend
Aug 24, 2026
Merged

yansigit merged 265 commits into
devfrom
codex/fix-web-search-sidecar-backend

Conversation

@yansigit

@yansigit yansigit commented Aug 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Preserve the selected web-search backend when validating model/backend pairs, including Gemini and xAI.
  • Keep Cursor model capability overrides ahead of curated static registry facts, so explicit modality and reasoning settings are not replaced.
  • Keep Cursor's static model facts non-stale internally while labeling them Cursor curated in the dashboard and documenting that Cursor discovery returns IDs without capability specs.
  • Derive Command Code session affinity only from trusted conversation or per-session cache identities; shared prompt-cache cohorts and identical opening messages no longer collide.
  • Preserve the shared-cache marker through opaque request recovery.

Models dashboard context controls

Verification

  • bun run typecheck (passed)
  • bun run lint:gui (passed)
  • bun run build:gui (passed)
  • bun test tests/model-metadata-resolver.test.ts tests/reasoning-replay-scope-source.test.ts (29 passed)
  • bun test tests/command-code-provider.test.ts -t 'session|streaming upstream' (5 passed)
  • bun test gui/tests/models-native-group-controls.test.ts (12 passed)
  • cd gui && bun run lint:i18n (passed)
  • bun test tests (full run attempted; the two existing OAuth callback tests hit EADDRINUSE)
  • cd gui && bun test tests (998 passed; one existing Cursor discovery test was blocked by sandbox EPERM on an ephemeral listener)

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

lidge-jun and others added 30 commits August 20, 2026 09:11
[WRONG BRANCH] release: promote dev to main for 2.27.0
[WRONG BRANCH] release: promote dev to main for 2.28.0
Probe retrieveUserQuota with catalog fallback, skip http Bearer
destinations, and surface Cloud Code Assist location blocks before
generic 403s.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent quota probes from following redirects or promoting daily summaries as weekly usage, and interpret explicit percentage fields without converting small percentages into fractions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Treat unreadable daily quota JSON as an RPC failure while allowing the optional summary call to fail without discarding the daily window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Restrict host failover to known Google daily/prod endpoints, require
explicit model identifiers for Gemini window parsing, and abort live
quota plus catalog probing on 401/403/429 instead of leaking tokens
to production peers.

Co-authored-by: Cursor <cursoragent@cursor.com>
…eekly on the leaf path

Co-authored-by: Cursor <cursoragent@cursor.com>
Key 429/quota/geoblock cooldowns by OAuth account, fail closed when a
rotated Cloud Code Assist credential has no project id, and sweep
expired entries with the state store.

Co-authored-by: Cursor <cursoragent@cursor.com>
Validate a cooldown-selected account's Cloud Code Assist project before promoting it, so missing project metadata cannot change the active account state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Record provider-attributed geo blocks, quota exhaustion, and rate limits at
 the retry boundary so account rotation can actually avoid unhealthy accounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Store AntigravityCooldownReason on account health, expose getAntigravityAccountCooldown,
and stop retrying the same account inside fetchGoogleWithRetry after recording cooldowns
so outer account rotation can switch credentials immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
Image and web-search loops now forward AdapterFetchContext.accountId so a
429/403 records the cooled account and the next eligible one is selected.

Co-authored-by: Cursor <cursoragent@cursor.com>
Operators can declare named specialists in config and manage them via
GET/PUT /api/subagent-roles and `ocx agent roles`, instead of stuffing
child prompts into argv. v2 guidance renders the catalog through {{roles}}.

Co-authored-by: Cursor <cursoragent@cursor.com>
Treat slash gpt-* models as routed unless the prefix is a configured
account selector, keep the five-slot roster unique, render only roles
inside the live v2 window, cap {{roles}} to the 700-char budget, and
remove roles atomically on the server so CLI delete cannot clobber a
concurrent save.

Co-authored-by: Cursor <cursoragent@cursor.com>
Write only $CODEX_HOME/agents/ocx-<id>.toml with allowed keys, never
model_fallback. User same-name agents win; owned files prune on disable
or remove. Unset syncCodexAgentRoles follows the catalog; GET reports
the stored tri-state separately from the effective flag so a status echo
cannot persist false.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give operators a dashboard catalog for named specialists, parent guidance, child instructions, and Codex agent-file sync without echoing the effective flag back as stored false.

Co-authored-by: Cursor <cursoragent@cursor.com>
….29.0

[WRONG BRANCH] promote: dev to main for v2.29.0
Probe retrieveUserQuota with catalog fallback, skip http Bearer
destinations, and surface Cloud Code Assist location blocks before
generic 403s.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent quota probes from following redirects or promoting daily summaries as weekly usage, and interpret explicit percentage fields without converting small percentages into fractions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Treat unreadable daily quota JSON as an RPC failure while allowing the optional summary call to fail without discarding the daily window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Restrict host failover to known Google daily/prod endpoints, require
explicit model identifiers for Gemini window parsing, and abort live
quota plus catalog probing on 401/403/429 instead of leaking tokens
to production peers.

Co-authored-by: Cursor <cursoragent@cursor.com>
…eekly on the leaf path

Co-authored-by: Cursor <cursoragent@cursor.com>
Send the interleaved-thinking header and preamble replacement, strip
trailing Claude prefills, repair orphan tool pairs, and parse unary CCA
as SSE with a pre-decode frame cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
yansigit and others added 14 commits August 24, 2026 06:08
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ci: automate fork sync daily-merge preparation
@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft August 24, 2026 19:00
@yansigit yansigit changed the title fix: preserve selected web-search sidecar backend fix: clarify Cursor metadata and session affinity Aug 24, 2026
@yansigit
yansigit changed the base branch from main to dev August 24, 2026 19:01
@github-actions
github-actions Bot marked this pull request as ready for review August 24, 2026 19:01
@yansigit

Copy link
Copy Markdown
Owner Author

Status update:

  • Cross-platform CI rerun completed successfully across all test shards, gates, packaging, storage/API, and keyring jobs.
  • React Doctor rerun still fails with only a generic .github#289 annotation and no actionable finding in the check output.
  • The head branch is 263 commits ahead of dev, so reducing this PR to the intended change set would require an explicit history rewrite or replacement PR.

…idecar-backend

# Conflicts:
#	src/adapters/command-code.ts
#	tests/command-code-provider.test.ts
#	tests/commandcode-provider.test.ts
@yansigit
yansigit merged commit 9381536 into dev Aug 24, 2026
27 checks passed
@yansigit
yansigit deleted the codex/fix-web-search-sidecar-backend branch August 24, 2026 20:04
@yansigit yansigit mentioned this pull request Aug 24, 2026
3 tasks done
cursor Bot pushed a commit that referenced this pull request Oct 12, 2026
…flag tool errors, system prompt in #2 (carry lidge-jun#6092) (lidge-jun#6178)

* fix(devin): system prompt in #2, tool-error flag, Gemini schemas, history overflow

- Send the leading system text as GetChatMessage #2 instead of folding it into
  the first user prompt. Live on swe-1-6 with a ~6.7k-token system prompt the
  turn-2 cache ratio is unchanged (6688/6715 vs 7072/7097) and the prompt is
  smaller; swe-1-6, swe-2-medium, gemini and claude all obey #2.
- Mark failed tool results with ChatMessagePrompt #9 tool_result_is_error
  instead of an in-band "ERROR:" prefix.
- Rewrite JSON-Schema type arrays to anyOf in tool parameters for Gemini uids,
  which Cognition refuses with invalid_argument on every turn.
- Surface a pre-output invalid_argument on a history near or past the model's
  input window as context_length_exceeded so Codex compacts; small requests
  with the same code stay a plain 400.
- Correct the #15 (CortexTrajectoryReference), #17 prompt_id and #22
  execution_id comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 29688bf)

* fix(devin): measured overflow boundary, per-type Gemini branches, tool-error marker

- Overflow: binary-searched live on swe-1-6 (200k window) the refusal sits at
  ~200-203k real tokens for prose and JSON alike, and a 32000 output cap does
  not move it. Characters per token ran 1.33-5.53 across samples, so the
  chars/4 estimate is replaced by a word-piece count (1.00-1.54x real) at 95%
  of the window: every sample at the window is caught, none at 60% is.
- Gemini schemas: `{type:[T,"null"], ...}` becomes anyOf branches that carry
  the type-specific keywords (items, properties, ...); an existing anyOf is
  folded in rather than nested under allOf. Draft-7 `dependencies` is walked as
  a schema map with name lists left as data.
- Tool errors keep the in-band ERROR: marker beside #9: with a neutral result
  flagged as an error only gemini reported a failure; swe-1-6, gpt-6-sol-low
  and gpt-5-6-luna-low read it as success.
- A request with only system text keeps it as a user prompt instead of
  sending no prompts.
- Docs: describe the context_length_exceeded reclassification beside the
  allowDevinInvalidArgument recovery option.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit d84edae)

* fix(devin): keep outer constraints when folding a Gemini anyOf

Folding each existing anyOf branch into the outer keywords let a branch
override a contradicting outer keyword, so `{maxLength: 5, anyOf:
[{maxLength: 50}]}` loosened to 50. On any such disagreement, keep both
constraints under allOf instead; live, gemini-3-8-flash-medium accepts
allOf.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit db28e2d)

* docs(devin): match the collapseSystemIntoUser example to the #2 system prompt

The example still showed the leading system messages folded into the
first user turn, which now travel in request #2. Show a mid-conversation
system run instead, with the real blank-line join, and note that a
system-only request passes through whole.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit b2d9ded)

* docs(devin): show the blank-line join in the collapse example

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3232330)

* fix(devin): keep both constraints when a Gemini type union and anyOf are disjoint

When no existing anyOf branch shared a type with the type array, the
fallback kept the anyOf and dropped the type union, so the branches
admitted types the node never allowed. Keep both under allOf, the same
form the conflict path uses; live, gemini-3-8-flash-medium accepts it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit b87b332)

* fix(devin): classify overflow from the selected catalog window

Co-authored-by: Sayo <hi@sayo.wtf>

* fix(devin): preserve null constraints in Gemini schema rewrite

Co-authored-by: Sayo <hi@sayo.wtf>

* docs(devin): record malformed-schema overflow ambiguity

Co-authored-by: Sayo <hi@sayo.wtf>

* fix(devin): preserve outer schema constraints on nullable types

Co-authored-by: Sayo <hi@sayo.wtf>

* fix(devin): estimate overflow from transmitted tool descriptions

Co-authored-by: Sayo <hi@sayo.wtf>

* docs(structure): keep the effective Devin family default in the adapter row

Co-authored-by: Sayo <hi@sayo.wtf>

---------

Co-authored-by: Sayo <hi@sayo.wtf>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants