ValidateCreateSessionRequest enforces the shared session workspace contract.
(prefix string, workspaceRef string, workspacePath string)
| 25 | |
| 26 | // ValidateCreateSessionRequest enforces the shared session workspace contract. |
| 27 | func validateCreateSessionRequest(prefix string, workspaceRef string, workspacePath string) error { |
| 28 | trimmedRef := strings.TrimSpace(workspaceRef) |
| 29 | trimmedPath := strings.TrimSpace(workspacePath) |
| 30 | |
| 31 | switch { |
| 32 | case trimmedRef == "" && trimmedPath == "": |
| 33 | return prefixedError(prefix, "workspace or workspace_path is required") |
| 34 | case trimmedRef != "" && trimmedPath != "": |
| 35 | return prefixedError(prefix, "workspace and workspace_path are mutually exclusive") |
| 36 | case trimmedPath != "": |
| 37 | return validateAbsolutePathInternal(prefix, "workspace_path", trimmedPath) |
| 38 | default: |
| 39 | return nil |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // validateCreateSessionRuntimeOverrides enforces the model + reasoning_effort |
| 44 | // invariants for create-session payloads. Provider must be set when either |