mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: normalize command paths to base names in shellparse (#25599)
Normalize program names in shellparse.Parse to their basename. Does not rely on filepath.Base because the server may run on either Linux or Windows where the behavior would differ. Closes CODAGT-470
This commit is contained in:
+3
-2
@@ -259,8 +259,9 @@ type ChatMessagePart struct {
|
||||
// ParsedCommands holds parsed programs from an execute tool call's
|
||||
// shell command, one entry per simple command in source order. Each
|
||||
// entry is [program] or [program, arg] where arg is the first non-flag
|
||||
// positional argument. Only populated when ToolName is "execute" and
|
||||
// the command parses successfully; nil otherwise.
|
||||
// positional argument. Program names are normalized to their base
|
||||
// name (e.g. /usr/bin/go becomes go). Only populated when ToolName
|
||||
// is "execute" and the command parses successfully; nil otherwise.
|
||||
ParsedCommands [][]string `json:"parsed_commands,omitempty" variants:"tool-call?"`
|
||||
Result json.RawMessage `json:"result,omitempty" variants:"tool-result?"`
|
||||
ResultDelta string `json:"result_delta,omitempty" variants:"tool-result?"`
|
||||
|
||||
Reference in New Issue
Block a user