Claude step: Fix bug with SRT where the claude settings flag was passed to SRT#2063
Conversation
| } | ||
|
|
||
| static string EscapeArg(string arg) | ||
| public static string EscapeArg(string arg) |
There was a problem hiding this comment.
Extract to another class?
There was a problem hiding this comment.
Alternatively, we could escape internally and call something like var claudeArgs = argsBuilder.BuildEscaped();.
Doesn't over the binary path - but that is probably safer and/or can be escaped elsewhere?
There was a problem hiding this comment.
I don't think the args builder should know how to escape the arguments (that's up to the caller).
I'd lean towards reusing this guy (in a later PR):
eddymoulton
left a comment
There was a problem hiding this comment.
You could change the way you've done it (see the comment in the args builder) but this is good enough to go in.
| arguments.Should().StartWith($"--settings {TestSandboxRuntimeSettingsPath} claude --model"); | ||
| // The claude invocation is passed as a single escaped argument to srt's -c flag. | ||
| arguments.Should().StartWith($"--settings {TestSandboxRuntimeSettingsPath} -c \"claude --model"); | ||
| arguments.Should().Contain("-p \\\"look! a \\\\\\\"quote\\\\\\\"\\\""); |
There was a problem hiding this comment.
This is a hilarious amount of escapes 😂
It might be clearer if we write it as a raw string literal ("""), but it's not a big deal.
There was a problem hiding this comment.
yeah raw looks better 😂
| } | ||
|
|
||
| static string EscapeArg(string arg) | ||
| public static string EscapeArg(string arg) |
There was a problem hiding this comment.
Alternatively, we could escape internally and call something like var claudeArgs = argsBuilder.BuildEscaped();.
Doesn't over the binary path - but that is probably safer and/or can be escaped elsewhere?
When running Claude inside SRT, the deployment fails because SRT is trying to read Claude's settings file. This PR calls Claude using the
-cflagRelated to MD-2265: SRT sandbox errors without helpful message