GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Created in error: context bridge PR by wianvdm · Pull Request #30140 · pingdotgg/t3code Conversation
|
| }); | ||
|
|
||
| for (const group of groups) { | ||
| if (isPreToolUse && !matchesTool(group.matcher, mapped.tool_name, agyPayload.toolCall && agyPayload.toolCall.name)) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High provider/antigravityHookShimSource.ts:223
PostToolUse hooks configured for Write or Edit run for every tool, and their commands receive an empty tool_name and tool_input, so tool-specific post-processing both runs on unrelated tools and cannot inspect the completed tool. The matcher check at line 223 only applies to PreToolUse, while the non-pre branch discards the post-tool identity; preserve that identity in the mapped payload and apply matchesTool to PostToolUse groups too.
In file @apps/server/src/provider/antigravityHookShimSource.ts around line 223:
PostToolUse hooks configured for `Write` or `Edit` run for every tool, and their commands receive an empty `tool_name` and `tool_input`, so tool-specific post-processing both runs on unrelated tools and cannot inspect the completed tool. The matcher check at line 223 only applies to `PreToolUse`, while the non-pre branch discards the post-tool identity; preserve that identity in the mapped payload and apply `matchesTool` to PostToolUse groups too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function resolveHookCommandString(command, projectDir, config) { | ||
| let expanded = command | ||
| .replace(/\$\{?CLAUDE_PROJECT_DIR\}?/g, projectDir.replaceAll("\\", "/")) | ||
| .replace(/\bnode\b/, "\"" + process.execPath.replaceAll("\\", "/") + "\""); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High provider/antigravityHookShimSource.ts:135
Hooks that invoke Node by absolute path are rewritten into invalid executable paths (for example, /usr/bin/node becomes /usr/bin/"/usr/bin/node"), so the hook does not run and the shim ultimately allows the tool without applying it. The \bnode\b match also finds node inside paths and quoted paths; restrict the rewrite to a bare node token at the start of the command.
| .replace(/\bnode\b/, "\"" + process.execPath.replaceAll("\\", "/") + "\""); | |
| .replace(/^(\s*)node(?=\s|$)/, "$1\"" + process.execPath.replaceAll("\\", "/") + "\""); |
In file @apps/server/src/provider/antigravityHookShimSource.ts around line 135:
Hooks that invoke Node by absolute path are rewritten into invalid executable paths (for example, `/usr/bin/node` becomes `/usr/bin/"/usr/bin/node"`), so the hook does not run and the shim ultimately allows the tool without applying it. The `\bnode\b` match also finds `node` inside paths and quoted paths; restrict the rewrite to a bare `node` token at the start of the command.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| yield* client.request("skills/extraRoots/set", { extraRoots: [] }).pipe( | ||
| Effect.catch((cause) => | ||
| Effect.logWarning("orchestration-v2.codex-extra-roots-clear-failed", { | ||
| cause, | ||
| }), | ||
| ), | ||
| ); | ||
| } | ||
| yield* Ref.set(lastSyncedExtraRoots, null); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High Adapters/CodexAdapterV2.ts:1909
When the clear RPC fails transiently, this still sets lastSyncedExtraRoots to null, so later syncs skip the clear and stale Codex roots remain registered for the session. Reset the cache only after client.request succeeds so a later sync retries the clear.
| yield* client.request("skills/extraRoots/set", { extraRoots: [] }).pipe( | |
| Effect.catch((cause) => | |
| Effect.logWarning("orchestration-v2.codex-extra-roots-clear-failed", { | |
| cause, | |
| }), | |
| ), | |
| ); | |
| } | |
| yield* Ref.set(lastSyncedExtraRoots, null); | |
| yield* client.request("skills/extraRoots/set", { extraRoots: [] }).pipe( | |
| Effect.tap(() => Ref.set(lastSyncedExtraRoots, null)), | |
| Effect.catch((cause) => | |
| Effect.logWarning("orchestration-v2.codex-extra-roots-clear-failed", { | |
| cause, | |
| }), | |
| ), | |
| ); |
In file @apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts around lines 1909-1917:
When the clear RPC fails transiently, this still sets `lastSyncedExtraRoots` to `null`, so later syncs skip the clear and stale Codex roots remain registered for the session. Reset the cache only after `client.request` succeeds so a later sync retries the clear.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ), | ||
| ); | ||
| const syncInput: AntigravityContextBridgeSyncInput = { | ||
| geminiHome: profile.geminiHome, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High Drivers/AntigravityDriver.ts:260
Starting a runtime for workspace B overwrites the bridged skills in the profile still used by workspace A, so A's live session can lose skills or read B's same-named skill files. makeRuntime passes each runtime's cwd to the sync but reuses the instance-wide profile.geminiHome; keep bridged skills in a runtime-specific profile or location.
apps/server/src/provider/antigravityContextBridge.ts:429
Workspace-specific skills are reconciled into a profile shared by every runtime of the provider instance.
AntigravityDriver.makeRuntimealways passes the sameprofileDirectory/geminiHome, but supplies each runtime's owncwd. Starting a session in workspace B therefore removes A-only entries at lines 221–224 and replaces same-named entries with B's copies at lines 234–247 while workspace A's runtime is still alive. A's copied skill resources can disappear or change to another project's contents mid-session; even a disposable setup runtime syncs against this same profile. Keep workspace-dependent skill copies in a runtime-specific profile/location rather than reconciling the shared one.
In file @apps/server/src/provider/Drivers/AntigravityDriver.ts around line 260:
Starting a runtime for workspace B overwrites the bridged skills in the profile still used by workspace A, so A's live session can lose skills or read B's same-named skill files. `makeRuntime` passes each runtime's `cwd` to the sync but reuses the instance-wide `profile.geminiHome`; keep bridged skills in a runtime-specific profile or location.
Also found in 1 other location(s):
- apps/server/src/provider/antigravityContextBridge.ts:429 -- Workspace-specific skills are reconciled into a profile shared by every runtime of the provider instance. `AntigravityDriver.makeRuntime` always passes the same `profileDirectory`/`geminiHome`, but supplies each runtime's own `cwd`. Starting a session in workspace B therefore removes A-only entries at lines 221–224 and replaces same-named entries with B's copies at lines 234–247 while workspace A's runtime is still alive. A's copied skill resources can disappear or change to another project's contents mid-session; even a disposable setup runtime syncs against this same profile. Keep workspace-dependent skill copies in a runtime-specific profile/location rather than reconciling the shared one.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| const owned: string[] = []; | ||
| for (const skill of skills) { | ||
| const destination = NodePath.join(configSkillsDir, skill.name); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High provider/antigravityContextBridge.ts:229
A skill with frontmatter name: ../../outside-skill makes NodePath.join(configSkillsDir, skill.name) target outside config/skills, so NodeFS.cpSync writes project content there; the name is also recorded in the ownership marker and can make cleanup recursively delete that outside path. Validate skill names as single path components before copying, and validate marker entries before deleting them.
In file @apps/server/src/provider/antigravityContextBridge.ts around line 229:
A skill with frontmatter `name: ../../outside-skill` makes `NodePath.join(configSkillsDir, skill.name)` target outside `config/skills`, so `NodeFS.cpSync` writes project content there; the name is also recorded in the ownership marker and can make cleanup recursively delete that outside path. Validate skill names as single path components before copying, and validate marker entries before deleting them.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .map((line) => { | ||
| const match = IMPORT_LINE.exec(line); | ||
| if (!match) return line; | ||
| const target = NodePath.resolve(NodePath.dirname(filePath), match[1]!); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High server/contextBridge.ts:291
A bridged @~/.claude/my-project-instructions.md import is left unexpanded, so its instructions never reach non-Claude targets. expandImports resolves every import relative to the importing file without expanding ~/; pass userHome into import resolution and expand home-relative paths before resolving file-relative imports.
In file @packages/provider-core/src/server/contextBridge.ts around line 291:
A bridged `@~/.claude/my-project-instructions.md` import is left unexpanded, so its instructions never reach non-Claude targets. `expandImports` resolves every import relative to the importing file without expanding `~/`; pass `userHome` into import resolution and expand home-relative paths before resolving file-relative imports.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!read) return line; | ||
| const key = read.realPath.toLowerCase(); | ||
| if (stack.has(key)) return line; | ||
| return expandImports(read.content, read.realPath, new Set([...stack, key])); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🔴 Critical server/contextBridge.ts:296
expandImports can perform exponential synchronous reads and string expansion for an acyclic import tree, blocking prompt assembly or exhausting server memory. Each sibling import recurses with its own stack, so cycle detection does not limit repeated work; enforce a shared budget for total imports/expanded bytes and a maximum depth before recursing.
In file @packages/provider-core/src/server/contextBridge.ts around line 296:
`expandImports` can perform exponential synchronous reads and string expansion for an acyclic import tree, blocking prompt assembly or exhausting server memory. Each sibling import recurses with its own stack, so cycle detection does not limit repeated work; enforce a shared budget for total imports/expanded bytes and a maximum depth before recursing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const match = IMPORT_LINE.exec(line); | ||
| if (!match) return line; | ||
| const target = NodePath.resolve(NodePath.dirname(filePath), match[1]!); | ||
| const read = readCandidate(target); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🔴 Critical server/contextBridge.ts:292
A project-controlled @path import can read and send arbitrary server-local files to the target provider, including files outside the checkout. expandImports resolves the path and calls readCandidate without checking containment or obtaining approval, so imports such as @../../.ssh/id_rsa, absolute paths, and symlinks bypass Claude Code’s external-import protection; resolve the real path and require explicit approval for imports outside the trusted workspace before reading them.
In file @packages/provider-core/src/server/contextBridge.ts around line 292:
A project-controlled `@path` import can read and send arbitrary server-local files to the target provider, including files outside the checkout. `expandImports` resolves the path and calls `readCandidate` without checking containment or obtaining approval, so imports such as `@../../.ssh/id_rsa`, absolute paths, and symlinks bypass Claude Code’s external-import protection; resolve the real path and require explicit approval for imports outside the trusted workspace before reading them.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| type InstructionTier = "global" | "project" | "local"; | ||
|
|
||
| // Claude-style `@path` import: a line whose only content is the pointer. | ||
| const IMPORT_LINE = /^[ \t]*@(\S+)[ \t]*\r?$/; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟠 High server/contextBridge.ts:275
Bridging a Claude file containing See @README.md or - @docs/conventions.md injects the reference text instead of the referenced instructions, so the non-Claude target never receives that content even though the file is reported as injected. IMPORT_LINE only matches lines consisting entirely of @path; match imports within each line and replace just the reference while preserving surrounding text.
In file @packages/provider-core/src/server/contextBridge.ts around line 275:
Bridging a Claude file containing `See @README.md` or `- @docs/conventions.md` injects the reference text instead of the referenced instructions, so the non-Claude target never receives that content even though the file is reported as injected. `IMPORT_LINE` only matches lines consisting entirely of `@path`; match imports within each line and replace just the reference while preserving surrounding text.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function expandImports(content: string, filePath: string, stack: ReadonlySet<string>): string { | ||
| return content | ||
| .split("\n") | ||
| .map((line) => { | ||
| const match = IMPORT_LINE.exec(line); | ||
| if (!match) return line; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium server/contextBridge.ts:285
A standalone @README.md inside a Markdown fenced example is expanded as an import, so the bridged prompt replaces the literal example with README contents and injects unintended text. expandImports processes every line without tracking fences; skip import expansion until the closing fence.
return content
.split("\n")
.map((line) => {
+ if (/^\s*```/.test(line)) {
+ inCodeFence = !inCodeFence;
+ return line;
+ }
+ if (inCodeFence) return line;
const match = IMPORT_LINE.exec(line);In file @packages/provider-core/src/server/contextBridge.ts around lines 285-290:
A standalone `@README.md` inside a Markdown fenced example is expanded as an import, so the bridged prompt replaces the literal example with README contents and injects unintended text. `expandImports` processes every line without tracking fences; skip import expansion until the closing fence.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This adds cross-provider context routing plus process UI and fork-release tooling. New diagnostic suppressions require human review, and the bridge’s local-file access and shared-profile writes need explicit trust-boundary and isolation decisions. Needs human approval because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.