Skip to content

fix(agent): route connector workspaces and redact secrets - #303

Merged
alwaysmavs merged 5 commits into
mainfrom
codex/fix-connector-session-routing
Aug 8, 2026
Merged

fix(agent): route connector workspaces and redact secrets#303
alwaysmavs merged 5 commits into
mainfrom
codex/fix-connector-session-routing

Conversation

@alwaysmavs

@alwaysmavs alwaysmavs commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Problem

The Connections page could show a provider such as PostHog as connected while a chat call intermittently returned app_not_found or connection_required. The behavior appeared probabilistic because Wanta's session-scoped Link tools selected the active team correctly, while Provider Skills could invoke a bare oo connector apps/run command that fell back to a different CLI identity.

Provider/account switching also had a short stale-inventory window: explicit connectionName validation cached the previous account list for five seconds, so a newly connected or selected account could be rejected until that cache expired.

Root cause

  • Raw Provider Skill commands were not guaranteed to carry the active OOMOL --team selector.
  • Leading global oo options could hide a connector command from the guard.
  • The raw CLI compatibility path only had a mutable workspace default and could silently route incorrectly when concurrent sessions used different workspaces.
  • Explicit connection-name validation reused a short-lived inventory cache across account switches.
  • Connector tool output could persist credential-shaped fields such as API tokens in OpenCode history and expose them again through the renderer.

Fix

  • Add a managed oo guard executable and shim for Agent-side calls.
    • Bind bare OOMOL connector apps/run commands to the active session workspace.
    • Parse documented global options and insert the selector before -- terminators.
    • Prefer the sole active session scope over a stale workspace default.
    • Ignore empty session scopes and fail closed when non-empty active scopes disagree.
    • Preserve explicit selectors and leave OpenConnector commands unscoped.
    • Escalate oversized-output termination from SIGTERM to SIGKILL after a bounded delay.
  • Preserve the current oo CLI identity.team key while collapsing retired or duplicate identity selectors into exactly one entry.
  • Strengthen the per-turn workspace contract for raw connector commands.
  • Refresh connection inventory on every explicit connectionName validation so newly switched accounts are immediately visible.
  • Redact exact, vendor-prefixed, and header-style credential fields before stdout/stderr reaches the Agent and before live/history tool results reach the renderer.
  • Run the persisted-history scrub in the background, restrict it to connector executions, preserve unchanged JSON byte-for-byte, and stop safely when the Agent is disposed.
  • Cap captured connector output at 32 MiB and fail closed when the guard cannot inspect it safely.

User impact

Connected providers should no longer intermittently appear disconnected because two invocation paths used different workspace identities. Rapid provider/account switching no longer waits for the old connection-name cache to expire. Ambiguous cross-team raw CLI calls now stop safely instead of reaching the wrong workspace.

Safety and Compatibility

  • No credential values are added to source, logs, renderer state, or the PR.
  • OpenConnector keeps its existing endpoint-scoped behavior and receives no team selector.
  • Explicit OOMOL selectors remain unchanged; only bare connector apps/run commands are bound.
  • Current oo CLI 1.7.1 compatibility was checked locally: the persisted key remains identity.team and the command-line selector remains --team.
  • Historical mutation is restricted to completed connector execution outputs containing credential-shaped values; unrelated tool history is not rewritten.
  • The history scrub is non-blocking and aborts without writing its completion marker if the Agent is disposed.
  • POSIX and Windows launchers preserve argument forwarding and child exit status; Windows environment changes are scoped with setlocal.
  • No database schema, IPC contract, network endpoint, or renderer API changes are introduced.

Validation

  • pnpm run lint
  • pnpm run ts-check
  • pnpm test — 295 files, 2208 tests passed
  • pnpm run build:app
  • Targeted formatting checks for every changed file
  • git diff --check

The production build includes dist-electron/wanta-oo-guard.js; only the existing bundle-size and deprecated inlineDynamicImports warnings remain.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa60517f-850c-41ab-93e2-fe76b9d4d470

📥 Commits

Reviewing files that changed from the base of the PR and between 5573b9f and cd45e24.

📒 Files selected for processing (2)
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts

Summary by CodeRabbit

  • Security

    • Sensitive connector credentials are automatically redacted from tool results, errors, and previously stored outputs.
    • Connector commands are safely scoped to the active workspace.
  • Bug Fixes

    • Switching connection accounts now refreshes available connections immediately.
    • Workspace identity settings now use the correct team configuration while preserving existing settings.
  • Reliability

    • Improved handling of ambiguous or missing workspace information, command failures, and oversized command output.
    • Connector safeguards now work consistently across supported platforms.

Walkthrough

The PR adds a managed oo wrapper for Link runtimes. The wrapper binds connector commands to a workspace, captures and redacts connector output, enforces a 32 MiB limit, and preserves exit statuses. Startup installs the wrapper and scrubs persisted tool outputs once. Live and historical tool events redact connector credentials. Identity settings normalize team and organization selectors. Connection inventory refreshes for each explicit connection validation.

Sequence Diagram(s)

sequenceDiagram
  participant AgentManager
  participant Sidecar
  participant OoGuard
  participant RealOo
  AgentManager->>Sidecar: start with managed oo path
  Sidecar->>OoGuard: execute connector command
  OoGuard->>RealOo: bind workspace and run command
  RealOo-->>OoGuard: connector output
  OoGuard-->>Sidecar: redacted output and exit status
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required type(scope): subject format, uses English, and accurately describes workspace routing and secret redaction.
Description check ✅ Passed The description explains the problem, root cause, fix, impact, safety considerations, and validation results, despite using different section headings than the template.
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.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/fix-connector-session-routing

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

@alwaysmavs
alwaysmavs marked this pull request as ready for review August 8, 2026 12:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (5)
electron/agent/oo-guard.ts (1)

39-56: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Escalate to SIGKILL after the size limit trips.

When the output exceeds the limit, the guard sends SIGTERM and then waits on the close promise. If the connector process ignores SIGTERM, the guard never resolves. The tool call then hangs with no timeout. Add a bounded escalation to SIGKILL.

♻️ Proposed change
+function killWithEscalation(child: ReturnType<typeof spawn>): void {
+  child.kill("SIGTERM")
+  const timer = setTimeout(() => child.kill("SIGKILL"), 5_000)
+  timer.unref?.()
+  child.once("close", () => clearTimeout(timer))
+}
+
 async function runGuarded(command: string, args: string[]): Promise<number> {

Then replace both child.kill("SIGTERM") calls with killWithEscalation(child).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/oo-guard.ts` around lines 39 - 56, Update both output-limit
error handlers in the child.stdout and child.stderr listeners to call the
existing or newly added killWithEscalation(child) helper instead of directly
sending SIGTERM. Ensure the helper sends SIGTERM first, then escalates to
SIGKILL after a bounded delay if the process has not exited, allowing the close
flow to resolve even when SIGTERM is ignored.
electron/agent/oo-guard-bin.ts (2)

28-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Return the launcher path instead of binDir.

The function returns binDir on both branches. The caller in electron/agent/manager.ts (line 574) then rebuilds the launcher name with process.platform. The launcher filename is therefore encoded in two places, and the caller ignores the platform option of this helper. Return the created command path so the caller uses it directly.

♻️ Proposed change
-    return binDir
+    return path.join(binDir, "oo.cmd")
   }
 
   const commandPath = path.join(binDir, "oo")
@@
   await chmod(commandPath, 0o755)
-  return binDir
+  return commandPath
 }

In electron/agent/manager.ts:

-      await ensureOoGuardCommandBin({
+      managedOoBinPath = await ensureOoGuardCommandBin({
         binDir: commandBinDir,
         nodeBin: process.execPath,
         ooGuardCliPath,
       })
-      managedOoBinPath = path.join(commandBinDir, process.platform === "win32" ? "oo.cmd" : "oo")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/oo-guard-bin.ts` around lines 28 - 44, Update the helper’s
return value to provide the launcher path, using commandPath on the creation
branch and the existing platform-specific launcher path on the early-return
branch. Then update the caller around the manager’s launcher setup to use this
returned path directly instead of rebuilding the filename from process.platform.

22-29: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider setlocal in the Windows launcher.

set ELECTRON_RUN_AS_NODE=1 has no scope guard. If a cmd shell invokes oo.cmd directly, the variable persists in that shell after the command returns. A later Electron invocation in the same shell then starts in Node mode. setlocal limits the assignment to the script.

♻️ Proposed change
       path.join(binDir, "oo.cmd"),
-      ["`@echo` off", "set ELECTRON_RUN_AS_NODE=1", `"${nodeBin}" "${ooGuardCliPath}" %*`, ""].join("\r\n"),
+      [
+        "`@echo` off",
+        "setlocal",
+        "set ELECTRON_RUN_AS_NODE=1",
+        `"${nodeBin}" "${ooGuardCliPath}" %*`,
+        "endlocal & exit /b %ERRORLEVEL%",
+        "",
+      ].join("\r\n"),
       "utf8",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/oo-guard-bin.ts` around lines 22 - 29, Update the Windows
launcher content in the platform === "win32" branch to scope
ELECTRON_RUN_AS_NODE=1 to oo.cmd by adding setlocal before the assignment.
Preserve the existing command invocation and generated line endings.
electron/agent/oo-guard-bin.test.ts (1)

14-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the executable mode and quoting of the POSIX launcher.

The test checks the file content only. It does not check the mode set by chmod(commandPath, 0o755). If that call is removed, the launcher stops working through PATH, and this test still passes. A path that contains a single quote also exercises shellQuote, which no test covers.

💚 Proposed additions
-import { mkdtemp, readFile, rm } from "node:fs/promises"
+import { mkdtemp, readFile, rm, stat } from "node:fs/promises"
     const source = await readFile(path.join(binDir, "oo"), "utf8")
     expect(source).toContain("ELECTRON_RUN_AS_NODE=1")
     expect(source).toContain("wanta-oo-guard.js")
     expect(source).toContain('"$@"')
+    const mode = (await stat(path.join(binDir, "oo"))).mode & 0o777
+    expect(mode & 0o111).not.toBe(0)

Note: skip the mode assertion on win32 if the suite runs there.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/oo-guard-bin.test.ts` around lines 14 - 27, Extend the POSIX
launcher test for ensureOoGuardCommandBin to stat the generated oo file and
assert it has executable mode 0o755, skipping this check on win32. Also use a
launcher path containing a single quote and assert the generated source
correctly quotes it, covering shellQuote behavior while preserving the existing
argument and Electron mode assertions.
electron/agent/oo-guard-core.test.ts (1)

78-107: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add an idempotence test for output without credentials.

The redaction tests only cover payloads that contain credentials. Add a case for pretty-printed JSON with no sensitive key. That case pins the contract that redactConnectorOutput returns the input unchanged, and it guards the persisted-scrub comparison in electron/agent/manager.ts (line 499). See the related issue on electron/agent/oo-guard-core.ts lines 50-61.

💚 Proposed test
   test("redacts credential fields from non-JSON errors", () => {
test("leaves output without credentials unchanged", () => {
  const output = `{\n  "data": {\n    "id": 173107,\n    "name": "CLI"\n  }\n}\n`
  assert.equal(redactConnectorOutput(output), output)
})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/oo-guard-core.test.ts` around lines 78 - 107, Add a test in
the “connector output redaction” suite verifying that pretty-printed JSON
without sensitive keys is returned byte-for-byte unchanged by
redactConnectorOutput. Use the existing assertion style and include
representative business fields such as id and name to cover the persisted-scrub
comparison contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/agent/manager.ts`:
- Around line 472-476: Update start() so it does not await
scrubPersistedConnectorOutputs(); launch the scrub asynchronously after the
sidecar is ready while preserving the existing catch-based warning and
diagnostic handling. If needed to prevent overlap with dispose(), retain the
background promise and have scrubPersistedConnectorOutputs() or its session loop
check this.disposed before continuing.
- Around line 496-509: Restrict the scrub loop around redactConnectorOutput to
connector executions only by adding a helper that inspects part.tool and
part.state.input. Allow connector tool parts, and allow shell parts only when
their recorded command invokes oo connector; skip read, unrelated bash, and
other tool outputs before persisting any part.update changes.

In `@electron/agent/oo-guard-core.ts`:
- Around line 2-28: Update normalizedKey and isSensitiveConnectorKey so
credential names are detected within prefixed or vendor-scoped fields, including
x-api-key and posthog_api_key, rather than requiring an exact set match; ensure
APIKey normalizes consistently with api_key. Also update
sensitiveAssignmentPattern to remove its leading word-boundary anchor so
underscore-prefixed assignment names are matched.
- Around line 50-61: Update redactConnectorOutput so the JSON branch compares
the redacted value with the original parsed value and returns the original
output unchanged when no sensitive content was modified. Only serialize the
redacted value when redaction actually occurs, preserving existing
trailing-newline behavior for changed output.
- Around line 98-111: Update resolveGuardWorkspaceTeam to filter out empty
strings after trimming session team values, so unset sessions do not participate
in the uniqueness check. If no non-empty session teams remain, fall back to
scope.teamName; preserve the existing ambiguity error when multiple distinct
non-empty teams are active and retain the empty-string result when no fallback
is present.
- Around line 63-78: Update isConnectorBusinessCommand and hasWorkspaceSelector
to parse past documented leading global options, including value-taking options
such as --lang zh, before identifying the connector command and its workspace
requirement; do not treat command-specific --json or undocumented -t as
global/selector support. When generating and appending a workspace selector,
insert it immediately before a -- terminator rather than after it, preserving
the remaining command arguments.

In `@electron/agent/oo-identity.ts`:
- Around line 54-56: Update the identity migration logic around the
organization/team replacement to remove every existing identity.team and
identity.organization entry, regardless of key order, before writing exactly one
organization entry when teamName is set. When teamName is unset, remove all
matching selectors without adding a replacement, and add tests covering both key
orders and removal.

---

Nitpick comments:
In `@electron/agent/oo-guard-bin.test.ts`:
- Around line 14-27: Extend the POSIX launcher test for ensureOoGuardCommandBin
to stat the generated oo file and assert it has executable mode 0o755, skipping
this check on win32. Also use a launcher path containing a single quote and
assert the generated source correctly quotes it, covering shellQuote behavior
while preserving the existing argument and Electron mode assertions.

In `@electron/agent/oo-guard-bin.ts`:
- Around line 28-44: Update the helper’s return value to provide the launcher
path, using commandPath on the creation branch and the existing
platform-specific launcher path on the early-return branch. Then update the
caller around the manager’s launcher setup to use this returned path directly
instead of rebuilding the filename from process.platform.
- Around line 22-29: Update the Windows launcher content in the platform ===
"win32" branch to scope ELECTRON_RUN_AS_NODE=1 to oo.cmd by adding setlocal
before the assignment. Preserve the existing command invocation and generated
line endings.

In `@electron/agent/oo-guard-core.test.ts`:
- Around line 78-107: Add a test in the “connector output redaction” suite
verifying that pretty-printed JSON without sensitive keys is returned
byte-for-byte unchanged by redactConnectorOutput. Use the existing assertion
style and include representative business fields such as id and name to cover
the persisted-scrub comparison contract.

In `@electron/agent/oo-guard.ts`:
- Around line 39-56: Update both output-limit error handlers in the child.stdout
and child.stderr listeners to call the existing or newly added
killWithEscalation(child) helper instead of directly sending SIGTERM. Ensure the
helper sends SIGTERM first, then escalates to SIGKILL after a bounded delay if
the process has not exited, allowing the close flow to resolve even when SIGTERM
is ignored.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b399b45-674a-46b9-9550-d6fe8598b14a

📥 Commits

Reviewing files that changed from the base of the PR and between c1a2f39 and 13df9b8.

📒 Files selected for processing (15)
  • electron/agent/event-translator.test.ts
  • electron/agent/event-translator.ts
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts
  • electron/agent/oo-guard-bin.test.ts
  • electron/agent/oo-guard-bin.ts
  • electron/agent/oo-guard-core.test.ts
  • electron/agent/oo-guard-core.ts
  • electron/agent/oo-guard.ts
  • electron/agent/oo-identity.test.ts
  • electron/agent/oo-identity.ts
  • electron/agent/tool-sources.test.ts
  • electron/agent/tool-sources.ts
  • electron/main.ts
  • vite.config.ts

Comment thread electron/agent/manager.ts Outdated
Comment thread electron/agent/manager.ts
Comment thread electron/agent/oo-guard-core.ts
Comment thread electron/agent/oo-guard-core.ts
Comment thread electron/agent/oo-guard-core.ts
Comment thread electron/agent/oo-guard-core.ts
Comment thread electron/agent/oo-identity.ts Outdated
@alwaysmavs alwaysmavs changed the title Fix connector workspace routing and redact secrets fix(agent): route connector workspaces and redact secrets Aug 8, 2026
@alwaysmavs

Copy link
Copy Markdown
Contributor Author

Addressed the AI review in e46b225. The update makes the history scrub non-blocking and connector-only, preserves unchanged JSON, expands prefixed credential redaction, parses leading oo global flags and argument terminators, ignores empty session scopes, deduplicates identity selectors, hardens process termination, and improves launcher behavior/tests. I also verified the bundled oo CLI 1.7.1 directly: its canonical persisted key is identity.team, so the migration now removes retired/duplicate selectors and writes exactly one team entry rather than adopting the review’s stale identity.organization assumption. Validation: lint and type-check passed; all 295 test files / 2208 tests passed; production build passed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
electron/agent/manager.ts (1)

503-509: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Make connector-output redaction complete before writing .connector-output-redaction-v1.

client.session.list applies limit directly and exposes no cursor. client.session.messages returns one bounded array. A response at 10_000 can leave persisted connector outputs unredacted while the marker is written. Use a complete enumeration path, or write the marker only after completeness is known. Add a test with more than 10_000 records.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@electron/agent/manager.ts` around lines 503 - 509, The connector-output scrub
loop around client.session.list and client.session.messages must not claim
completion when either bounded response may be truncated. Replace the
fixed-limit enumeration with a complete pagination/enumeration path, or track
completeness and defer writing .connector-output-redaction-v1 until all sessions
and messages are confirmed processed; add a test covering more than 10,000
records.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/agent/manager.ts`:
- Around line 317-327: The shellConnectorCommandPattern used by
isPersistedConnectorToolPart must not identify “oo connector” text inside quoted
arguments. Replace the regex-only command detection with shell-aware parsing
that recognizes connector invocations only at executable command positions,
while preserving supported oo/WANTA_OO_BIN options; add a regression case
covering quoted text such as printf with “oo connector run demo”.

---

Outside diff comments:
In `@electron/agent/manager.ts`:
- Around line 503-509: The connector-output scrub loop around
client.session.list and client.session.messages must not claim completion when
either bounded response may be truncated. Replace the fixed-limit enumeration
with a complete pagination/enumeration path, or track completeness and defer
writing .connector-output-redaction-v1 until all sessions and messages are
confirmed processed; add a test covering more than 10,000 records.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 53e90d56-4b9a-448e-b84c-98582ed57d2a

📥 Commits

Reviewing files that changed from the base of the PR and between 13df9b8 and e46b225.

📒 Files selected for processing (9)
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts
  • electron/agent/oo-guard-bin.test.ts
  • electron/agent/oo-guard-bin.ts
  • electron/agent/oo-guard-core.test.ts
  • electron/agent/oo-guard-core.ts
  • electron/agent/oo-guard.ts
  • electron/agent/oo-identity.test.ts
  • electron/agent/oo-identity.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • electron/agent/oo-guard-bin.test.ts
  • electron/agent/oo-guard-core.test.ts
  • electron/agent/oo-guard-bin.ts
  • electron/agent/oo-guard.ts
  • electron/agent/oo-guard-core.ts

Comment thread electron/agent/manager.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/agent/manager.ts`:
- Around line 346-354: Extend shellExecutesConnectorBusinessCommand to
recursively inspect executable $(...) command substitutions and assignment
right-hand sides using the existing quote-aware parsing rules, while preserving
depth protection and direct/nested command detection. Ensure connector commands
in forms such as quoted substitutions and assignments return true so persisted
output is scrubbed. Add regression tests covering both command-substitution and
assignment cases.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e81f289-0c4f-47ff-b97e-3fbfb9e5a3ab

📥 Commits

Reviewing files that changed from the base of the PR and between e46b225 and c7478a2.

📒 Files selected for processing (2)
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • electron/agent/manager.test.ts

Comment thread electron/agent/manager.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@electron/agent/manager.ts`:
- Around line 408-412: Update shellExecutesConnectorBusinessCommand to remove or
exclude shell comment text before calling executableCommandSubstitutions and
recursively evaluating command bodies, so commented commands such as # $(...)
return false. Add a regression test covering a commented connector command and
verify it does not trigger scrubbing.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1dea05b5-430f-41bd-ae5b-43ca7b48e17f

📥 Commits

Reviewing files that changed from the base of the PR and between c7478a2 and 5573b9f.

📒 Files selected for processing (2)
  • electron/agent/manager.test.ts
  • electron/agent/manager.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • electron/agent/manager.test.ts

Comment thread electron/agent/manager.ts
@alwaysmavs
alwaysmavs merged commit 8bddbc7 into main Aug 8, 2026
3 checks passed
@alwaysmavs
alwaysmavs deleted the codex/fix-connector-session-routing branch August 8, 2026 13:07
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