-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Re-supply user-declared external agent launchers on resume #10503
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
base: main
Are you sure you want to change the base?
Changes from 12 commits
03d0d14
70952ab
7bd1e36
583f03d
460b816
8c45fcb
25a402a
2e4ae56
48a8ce0
107ce35
25bc14f
5ed8c1e
3300928
98a9ec1
9ca1d19
beb802c
db755b9
b0f375f
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 |
|---|---|---|
|
|
@@ -17,6 +17,9 @@ extension CMUXCLI { | |
| if let launcher = command.launcher { | ||
| payload["launcher"] = launcher | ||
| } | ||
| if let externalLauncher = command.externalLauncher { | ||
| payload["external_launcher"] = externalLauncher | ||
| } | ||
| if let executablePath = command.executablePath { | ||
| payload["executable_path"] = executablePath | ||
| } | ||
|
|
@@ -163,7 +166,10 @@ extension CMUXCLI { | |
| observedPermissionMode: record.permissionMode | ||
| ) | ||
| guard let invocation = AgentRestorePlanner( | ||
| executableFileResolver: AgentRestoreExecutableFileResolver() | ||
| executableFileResolver: AgentRestoreExecutableFileResolver(), | ||
| externalLaunchers: externalAgentLaunchers( | ||
| workingDirectory: effectiveWorkingDirectory ?? record.launchCommand?.workingDirectory | ||
| ) | ||
|
Comment on lines
168
to
+176
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.
When the saved working directory is unavailable, Knowledge Base Used: CLI tool ( |
||
| ).invocation( | ||
| for: request, | ||
| ambientEnvironment: processEnvironment | ||
|
|
@@ -500,6 +506,7 @@ extension CMUXCLI { | |
| } | ||
| return AgentLaunchCommand( | ||
| launcher: object["launcher"] as? String, | ||
| externalLauncher: object["external_launcher"] as? String, | ||
| executablePath: object["executable_path"] as? String, | ||
| arguments: arguments, | ||
| workingDirectory: object["working_directory"] as? String, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a saved session working directory no longer exists and
cmux restoreruns from another project,effectiveWorkingDirectorybecomes the invocation directory and launcher resolution searches that project's configuration. This can select a different prefix for the captured launcher ID or omit the original declaration, causing the agent to resume through the wrong wrapper or without one.Knowledge Base Used: CLI tool (
cmux)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real, and worse than it looks:
effectiveWorkingDirectoryfalls back to the invocation directory precisely when the saved one is gone, so runningcmux restore --surfacefrom another repo would resolve that repo'sagents.launchersand apply its prefix to this session's captured id — a wrapper the session never ran under.Resolution now uses the session's own recorded directory (
record.launchCommand?.workingDirectory ?? record.workingDirectory) and never the invocation directory. When neither is recorded, only the user-level config applies, which is the conservative end.