Repository navigation
Add native OMO Slim launchers #8165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
01b1f08
05cabe6
30959df
bf20bef
45aba72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,8 @@ extension CMUXCLI { | |
| "notify", | ||
| "omc", | ||
| "omo", | ||
| "omo-slim", | ||
| "omos", | ||
| "omx", | ||
| "open", | ||
| "open-browser", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3702,6 +3702,16 @@ struct CMUXCLI { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command == "omo-slim" || command == "omos" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try runOMOSlim( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcher: command, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandArgs: commandArgs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| socketPath: resolvedSocketPath, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| explicitPassword: socketPasswordArg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command == "omx" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try runOMX( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandArgs: commandArgs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -16015,6 +16025,25 @@ struct CMUXCLI { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omo --continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omo --model claude-sonnet-4-6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "omo-slim", "omos": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return String(localized: "cli.omoSlim.usage", defaultValue: """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Usage: cmux omo-slim [opencode-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omos [opencode-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Launch OpenCode with oh-my-opencode-slim 2.2+ using its native cmux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| multiplexer. Install and configure the plugin before using this command. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This command: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - preserves the active OpenCode and OMO Slim configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - selects an available OpenCode API port for background agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - enables OpenCode background subagents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - forwards all remaining arguments to opencode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Examples: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omo-slim | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omos --continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmux omos --model openai/gpt-5.6-sol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "omx": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return String(localized: "cli.omx.usage", defaultValue: """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Usage: cmux omx [omx-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -23064,6 +23093,78 @@ struct CMUXCLI { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw CLIError(message: "Failed to launch opencode: \(String(cString: strerror(code)))\n\nIs opencode installed? Install with:\n npm install -g opencode-ai") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // MARK: - cmux omo-slim (native cmux multiplexer) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private func runOMOSlim( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcher: String, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandArgs: [String], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| socketPath: String, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| explicitPassword: String? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) throws { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var launcherEnvironment = ProcessInfo.processInfo.environment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcherEnvironment["CMUX_SOCKET_PATH"] = socketPath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcherEnvironment.removeValue(forKey: "CMUX_SOCKET") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("CMUX_SOCKET_PATH", socketPath, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unsetenv("CMUX_SOCKET") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if let explicitPassword, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !explicitPassword.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcherEnvironment["CMUX_SOCKET_PASSWORD"] = explicitPassword | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("CMUX_SOCKET_PASSWORD", explicitPassword, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| guard let openCodeExecutablePath = resolveOpenCodeExecutable(searchPath: launcherEnvironment["PATH"]) else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw CLIError(message: missingProviderExecutableMessage( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: "OpenCode", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| executableName: "opencode" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if launcherEnvironment["CMUX_WORKSPACE_ID"] == nil || launcherEnvironment["CMUX_SURFACE_ID"] == nil, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let focusedContext = try tmuxCompatFocusedContext( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| processEnvironment: launcherEnvironment, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| explicitPassword: explicitPassword | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcherEnvironment["CMUX_WORKSPACE_ID"] = focusedContext.workspaceId | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("CMUX_WORKSPACE_ID", focusedContext.workspaceId, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if let surfaceId = focusedContext.surfaceId { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcherEnvironment["CMUX_SURFACE_ID"] = surfaceId | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("CMUX_SURFACE_ID", surfaceId, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
cursor[bot] marked this conversation as resolved.
Resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Fix the combined-OR guard that lets a valid The condition at line 23123 uses OR: Gate each assignment on its own missing-ness instead of the combined condition. 🐛 Proposed fix to scope each overwrite to its own missing value- if launcherEnvironment["CMUX_WORKSPACE_ID"] == nil || launcherEnvironment["CMUX_SURFACE_ID"] == nil,
- let focusedContext = try tmuxCompatFocusedContext(
- processEnvironment: launcherEnvironment,
- explicitPassword: explicitPassword
- ) {
- launcherEnvironment["CMUX_WORKSPACE_ID"] = focusedContext.workspaceId
- setenv("CMUX_WORKSPACE_ID", focusedContext.workspaceId, 1)
- if let surfaceId = focusedContext.surfaceId {
- launcherEnvironment["CMUX_SURFACE_ID"] = surfaceId
- setenv("CMUX_SURFACE_ID", surfaceId, 1)
- }
- }
+ let missingWorkspaceId = launcherEnvironment["CMUX_WORKSPACE_ID"] == nil
+ let missingSurfaceId = launcherEnvironment["CMUX_SURFACE_ID"] == nil
+ if missingWorkspaceId || missingSurfaceId,
+ let focusedContext = try tmuxCompatFocusedContext(
+ processEnvironment: launcherEnvironment,
+ explicitPassword: explicitPassword
+ ) {
+ if missingWorkspaceId {
+ launcherEnvironment["CMUX_WORKSPACE_ID"] = focusedContext.workspaceId
+ setenv("CMUX_WORKSPACE_ID", focusedContext.workspaceId, 1)
+ }
+ if missingSurfaceId, let surfaceId = focusedContext.surfaceId {
+ launcherEnvironment["CMUX_SURFACE_ID"] = surfaceId
+ setenv("CMUX_SURFACE_ID", surfaceId, 1)
+ }
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let openCodePort = omoResolvedPort( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandArgs: commandArgs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| processEnvironment: launcherEnvironment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("OPENCODE_PORT", openCodePort, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if launcherEnvironment["OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS"] == nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv("OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS", "true", 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var effectiveArgs = commandArgs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if omoRequestedPort(from: commandArgs) == nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effectiveArgs.insert(contentsOf: ["--port", openCodePort], at: 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23136
to
+23139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🌐 Web query:
💡 Result: For the OpenCode CLI, global flags must be placed before any subcommand [1]. When using the OpenCode CLI, you should provide global flags (such as --debug, --cwd, --version, or --help) directly after the root command, preceding any specific command or subcommand [1][2]. For example: opencode --debug [subcommand] [arguments] opencode -c /path/to/project [subcommand] [arguments] The CLI follows standard command-line conventions where global flags are parsed at the root level [1][2]. Placing them after a subcommand may result in the CLI incorrectly identifying the flags as arguments belonging to that specific subcommand, or the flags may simply be ignored [1][3]. Always prioritize placing them before the subcommand to ensure they are correctly interpreted as global configuration settings [1][2]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate and inspect the referenced code and the matching runOMO logic.
wc -l CLI/cmux.swift
sed -n '23120,23170p' CLI/cmux.swift
printf '\n--- runOMO occurrences ---\n'
rg -n "func runOMO|omoRequestedPort|int \\(\"--port\"|append contentsOf: \\(\"--port\"" CLI/cmux.swift
printf '\n--- relevant omo request/port handling ---\n'
sed -n '22700,23100p' CLI/cmux.swiftRepository: manaflow-ai/cmux Length of output: 1918 🌐 Web query:
💡 Result: In the OpenCode CLI, the --port flag is not a global flag; it is a command-specific option [1][2][3]. Because it is specific to commands such as run or serve, it must be placed after the subcommand, not before it [4][5]. Global flags in the OpenCode CLI are limited to options that apply to every command, such as --help, --version, --print-logs, --log-level, and --pure [1][6][4]. Since --port is associated with the configuration of the underlying server or local listener for specific operations, it is defined within the builder for those subcommands (e.g., in the run or serve command definitions) rather than at the root level [7][5][8]. Therefore, you should use the structure: opencode --port For example: opencode run --port 4096 opencode serve --port 4096 Citations:
Move
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let executablePath = resolvedExecutableURL()?.path ?? (args.first ?? "cmux") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exportAgentLaunchCommandEnvironment( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| launcher: launcher, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| executablePath: executablePath, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arguments: [executablePath, launcher] + effectiveArgs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDirectory: launcherEnvironment["PWD"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var argv = ([openCodeExecutablePath] + effectiveArgs).map { strdup($0) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defer { argv.forEach { free($0) } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| argv.append(nil) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let code = cliExecFailureErrno { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execv(openCodeExecutablePath, &argv) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw CLIError(message: "Failed to launch opencode: \(String(cString: strerror(code)))") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // MARK: - cmux omx (Oh My Codex) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private func resolveOMXExecutable(searchPath: String?) -> String? { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -36245,6 +36346,7 @@ export default CMUXSessionRestore; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| claude-teams [claude-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| codex-teams [codex-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| omo [opencode-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| omo-slim [opencode-args...] (alias: omos) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| omx [omx-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| omc [omc-args...] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hooks setup|uninstall [--agent <name>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,14 +40,15 @@ public struct AgentForkArgv: Sendable, Equatable { | |||||||||||||||||||||||||||||||||||||||||
| return .resolved(nil) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| return .resolved([parts.executable, "codex-teams", "fork", sessionId] + preserved) | ||||||||||||||||||||||||||||||||||||||||||
| case "omo": | ||||||||||||||||||||||||||||||||||||||||||
| case "omo", "omo-slim", "omos": | ||||||||||||||||||||||||||||||||||||||||||
| guard let launcherName = launcher else { return .passthrough } | ||||||||||||||||||||||||||||||||||||||||||
| let parts = commandParts(executablePath: executablePath, arguments: arguments, fallbackExecutable: "cmux") | ||||||||||||||||||||||||||||||||||||||||||
| var tail = parts.tail | ||||||||||||||||||||||||||||||||||||||||||
| if tail.first == "omo" { tail.removeFirst() } | ||||||||||||||||||||||||||||||||||||||||||
| if tail.first == launcherName { tail.removeFirst() } | ||||||||||||||||||||||||||||||||||||||||||
| guard let preserved = AgentLaunchSanitizer.preservedArguments(kind: "opencode", args: tail) else { | ||||||||||||||||||||||||||||||||||||||||||
| return .resolved(nil) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| return .resolved([parts.executable, "omo", "--session", sessionId, "--fork"] + preserved) | ||||||||||||||||||||||||||||||||||||||||||
| return .resolved([parts.executable, launcherName, "--session", sessionId, "--fork"] + preserved) | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||||||||||||||||||||||||
| case "omx", "omc": | ||||||||||||||||||||||||||||||||||||||||||
| return .resolved(nil) | ||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,11 +10,17 @@ import Foundation | |
| /// capture verbatim poisons resume/fork for the session — the rendered command | ||
| /// runs the wrong binary with the wrong flags. | ||
| public enum AgentLaunchCaptureTrust { | ||
| private static let openCodeSessionWrapperLaunchers: Set<String> = [ | ||
| "omo", | ||
| "omo-slim", | ||
| "omos", | ||
| ] | ||
|
|
||
| /// Wrapper launchers that legitimately differ from the hook kind they launch. | ||
| private static let wrapperLaunchersByKind: [String: Set<String>] = [ | ||
| "claude": ["claudeteams"], | ||
| "codex": ["codexteams"], | ||
| "opencode": ["omo", "omx", "omc"], | ||
| "opencode": openCodeSessionWrapperLaunchers.union(["omx", "omc"]), | ||
| "pi": ["omp"], | ||
| ] | ||
|
|
||
|
|
@@ -32,7 +38,7 @@ public enum AgentLaunchCaptureTrust { | |
| "kiro": ["kiro", "kiro-cli"], | ||
| "kimi": ["kimi", "kimi-cli", "kimi-code"], | ||
| "omp": ["omp"], | ||
| "opencode": ["opencode", "omo", "omx", "omc"], | ||
| "opencode": openCodeSessionWrapperLaunchers.union(["opencode", "omx", "omc"]), | ||
| "pi": ["pi", "omp"], | ||
| "qoder": ["qodercli", "qoder"], | ||
| "rovodev": ["rovodev", "rovo", "rovo-dev"], | ||
|
|
@@ -53,6 +59,12 @@ public enum AgentLaunchCaptureTrust { | |
| return wrapperLaunchersByKind[normalizedKind]?.contains(normalizedLauncher) == true | ||
| } | ||
|
|
||
| public static func launcherIsOpenCodeSessionWrapper(_ launcher: String?) -> Bool { | ||
| guard let launcher = launcher?.trimmingCharacters(in: .whitespacesAndNewlines), | ||
| !launcher.isEmpty else { return false } | ||
| return openCodeSessionWrapperLaunchers.contains(launcher.lowercased()) | ||
| } | ||
|
Comment on lines
+62
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rule Used: Flag correctness-critical detection/identity deriv... (source)
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| /// True when a captured argv describes a shell dispatcher (`sh -c …`, | ||
| /// `zsh -lc …`) rather than an agent launch. This happens when the | ||
| /// launch-capture PID fallback resolves to the hook's own dispatch shell | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.