Skip to content

feat: Command Code projectContext, Antigravity in-turn grounding, Cursor native-exec bridge - #17

Merged
yansigit merged 4 commits into
mainfrom
feat/cc-antigravity-cursor-bridges
Aug 24, 2026
Merged

yansigit merged 4 commits into
mainfrom
feat/cc-antigravity-cursor-bridges

Conversation

@yansigit

Copy link
Copy Markdown
Owner

Summary

Three independent feature slices, one commit each:

  • feat(command-code) — opt-in projectContext envelope for /alpha/generate. New projectContext: "on" on the OAuth command-code provider fills memory (AGENTS.md), taste (.commandcode/taste/taste.md), and skills (SKILL.md under .commandcode/skills, .agents/skills, .pi/skills) from bounded files under process.cwd(). Absent or "off" keeps the empty envelope; the API-key commandcode preset is unaffected and x-taste-learning stays "false". The loader is fail-soft with canonical-path confinement (symlink-escape proof), cap+1 bounded reads with handle cleanup on timeout, a 256-entry scan cap on skill directories, per-file byte caps with XML escaping, and a 128-entry TTL cache that does not evict siblings on refresh. OAuth upsert preserves projectContext, and the Lab behavior fingerprint records wire.commandCodeProjectContext for command-code only.
  • feat(antigravity) — in-turn CCA grounding on the main routed fetch. For Antigravity (CCA) Gemini routes, google_search and url_context built-in tools ride the main routed fetch instead of the web-search sidecar loop when the turn has no conflicting Codex function tools. A per-request FIFO emitInTurnGroundingSourcesQueue keeps grounding state isolated across concurrent requests (enqueued only on a successful buildRequest return, shifted in parseStream). The mixed-tool 400 detector requires coexistence language near a function/tool term, so schema-only errors naming a builtin fall through to schema repair. Media/grounding ordering counts media as tool-presence only when the media branch will actually inject this turn. CCA grounding sources are routed through the shared safe-source validator and the search-suggestion HTML filter is gated on the per-request CCA flag.
  • feat(cursor) — bridge native exec to Codex shell when nativeLocalExec is off. When nativeLocalExec is not "on" and the turn advertises a bare Codex shell_command or exec_command bridge tool, native Shell/Read/Ls/Grep/Fetch exec frames map to that Codex shell tool call instead of executing on the proxy host; write/delete stay refused. The bridge selector honors the catalog order of CODEX_SHELL_BRIDGE_TOOL_NAMES. Adds the design spec and updates the transports reference and adapter docs across locales.

Verification

  • bun run typecheck (strict + replit-gateway): passed.
  • Focused suites across all three slices (command-code-project-context, command-code-provider, oauth-upsert-preserves-api-key, config, routing-compatibility-auth-identity, google-wire-compiler, google-vertex-http, gemini-web-search, google-antigravity-wire, cursor-native-exec-bridge): 226/226 pass.
  • core-lab-boundary + web-search-loop: 15/15 pass — no Lab import boundary violation, no loop regression.
  • Each fix was written TDD (failing test first → minimal fix → green).

Checklist

  • Behavior changes in src/ have focused regression tests.
  • bun run typecheck passed.
  • Focused tests passed.
  • Docs synced across locales (providers, sidecars, adapters, configuration/providers).
  • No request bodies, API keys, or account identifiers logged.

Fork-only PR against origin/main (yansigit/opencodex). The .superpowers/ scratch directory was deliberately not committed.

Made with Cursor

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 24, 2026
yansigit and others added 4 commits August 24, 2026 02:58
…erate

Adds `projectContext: "on"` on the OAuth `command-code` provider. When on,
the adapter fills `/alpha/generate` `memory` (AGENTS.md), `taste`
(.commandcode/taste/taste.md), and `skills` (SKILL.md under
.commandcode/skills, .agents/skills, .pi/skills) from bounded files under
process.cwd(). Absent or "off" keeps the empty envelope; the API-key
`commandcode` preset is unaffected and `x-taste-learning` stays "false".

Loader is fail-soft with confinement and resource bounds: canonical-path
confinement prevents symlink escape, cap+1 bounded reads with handle cleanup
on timeout, a 256-entry scan cap on skill directories, per-file byte caps
with XML escaping, and a 128-entry TTL cache that does not evict siblings on
refresh. OAuth upsert preserves projectContext, and the Lab behavior
fingerprint records `wire.commandCodeProjectContext` for command-code only.

Co-authored-by: Cursor <cursoragent@cursor.com>
For Antigravity (CCA) Gemini routes, `google_search` and `url_context`
built-in tools ride the main routed fetch instead of the web-search sidecar
loop when the turn has no conflicting Codex function tools. A per-request
FIFO `emitInTurnGroundingSourcesQueue` keeps grounding state isolated
across concurrent requests; the flag is enqueued only on a successful
buildRequest return and shifted in parseStream, so a buildRequest that
throws cannot desynchronize a later turn.

The mixed-tool 400 detector requires coexistence language (mix/combine/
coexist/alongside/together/use-with/not-supported-with/mutually-exclusive)
near a function/tool term, so schema-only errors naming a builtin fall
through to schema repair instead of burning the single replay on a strip.
On a genuine mixed-tool 400, builtins are stripped; if stripping is a
no-op the request falls through to schema repair. Media/grounding
ordering: image/video plans are computed before the grounding gate and
count as tool-presence only when the media branch will actually inject
this turn, so non-streaming video or web-search-wins turns keep in-turn
grounding on Gemini 2.x. CCA grounding sources are routed through the
shared safe-source validator (http(s) URLs, control-char strip, count
and byte budgets) and the search-suggestion HTML filter is gated on the
per-request CCA flag.

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

When `nativeLocalExec` is not "on" and the turn advertises a bare Codex
`shell_command` or `exec_command` bridge tool, native Shell/Read/Ls/Grep/Fetch
exec frames map to that Codex shell tool call instead of executing on the
proxy host; write/delete stay refused. `nativeLocalExec: "on"` still runs
native exec on the proxy host. The bridge selector honors the catalog order
of CODEX_SHELL_BRIDGE_TOOL_NAMES so a client advertising both aliases picks
`exec_command`. The live transport hook emits no native exec frames while
the bridge is active. Adds the design spec and updates the transports
reference and adapter docs across locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
…in web-search mock stub

The Antigravity in-turn-grounding slice added mediaBridgeWillRun and
resolveCcaInTurnGrounding imports to src/server/responses/core.ts from
../../web-search. tests/images/z-handler-activation.test.ts mocks the whole
web-search/index module with a stub, so the stub must provide both exports
or the test fails to load with "Export named ... not found". mediaBridgeWillRun
replicates the real pure function so the runTurn streaming image-bridge
activation cases still exercise the documented priority.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yansigit
yansigit force-pushed the feat/cc-antigravity-cursor-bridges branch from c4e609e to 9e67838 Compare August 24, 2026 08:59
@yansigit
yansigit merged commit ab8d8f4 into main Aug 24, 2026
27 checks passed
@yansigit
yansigit deleted the feat/cc-antigravity-cursor-bridges branch August 24, 2026 09:10
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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant