Skip to content

Commit e9d8dd3

Browse files
committed
fixup! feat: add experimental ACP mode (--experimental-acp)
1 parent 8c8da69 commit e9d8dd3

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

cmd/attach/attach.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ func WriteRawInputOverHTTP(ctx context.Context, url string, msg string) error {
129129
return nil
130130
}
131131

132-
133132
// statusResponse is used to parse the /status endpoint response.
134-
// The ACPMode field may not be present on older servers.
135133
type statusResponse struct {
136134
Status string `json:"status"`
137135
AgentType string `json:"agent_type"`
@@ -143,17 +141,15 @@ func checkACPMode(remoteUrl string) error {
143141
if err != nil {
144142
return xerrors.Errorf("failed to check server status: %w", err)
145143
}
146-
defer resp.Body.Close()
144+
defer func() { _ = resp.Body.Close() }()
147145

148146
if resp.StatusCode != http.StatusOK {
149-
// Server doesn't support /status or had an error, continue anyway
150-
return nil
147+
return xerrors.Errorf("unexpected %d response from server: %s", resp.StatusCode, resp.Status)
151148
}
152149

153150
var status statusResponse
154151
if err := json.NewDecoder(resp.Body).Decode(&status); err != nil {
155-
// Can't parse response, continue anyway
156-
return nil
152+
return xerrors.Errorf("failed to decode server status: %w", err)
157153
}
158154

159155
if status.ACPMode {

openapi.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,6 @@
265265
"readOnly": true,
266266
"type": "string"
267267
},
268-
"acp_mode": {
269-
"description": "Whether the server is running in ACP mode.",
270-
"type": "boolean"
271-
},
272268
"agent_type": {
273269
"description": "Type of the agent being used by the server.",
274270
"type": "string"

0 commit comments

Comments
 (0)