Skip to content

Commit a9ccb08

Browse files
chore: generate
1 parent ebe6087 commit a9ccb08

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

packages/opencode/src/server/routes/instance/httpapi/middleware/error.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
3636
}),
3737
Effect.map(normalizeEmptyBadRequest),
3838
Effect.catchCause((cause) => {
39-
const schemaError = cause.reasons
40-
.filter(Cause.isDieReason)
41-
.find((reason) => HttpApiSchemaError.is(reason.defect))
39+
const schemaError = cause.reasons.filter(Cause.isDieReason).find((reason) => HttpApiSchemaError.is(reason.defect))
4240
if (schemaError) return Effect.succeed(badRequestResponse())
4341

4442
const defect = cause.reasons.filter(Cause.isDieReason).find((reason) => {
@@ -63,7 +61,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
6361
return 500
6462
}),
6563
}),
66-
)
64+
)
6765
}
6866
if (error instanceof Session.BusyError) {
6967
return Effect.succeed(

packages/opencode/test/server/httpapi-instance.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,14 @@ describe("instance HttpApi", () => {
137137
)
138138
const [permission, questionReply, questionReject] = yield* Effect.all(
139139
[
140-
request("/permission/invalid-permission-id/reply", { method: "POST", body: JSON.stringify({ reply: "once" }) }),
141-
request("/question/invalid-question-id/reply", { method: "POST", body: JSON.stringify({ answers: [["Yes"]] }) }),
140+
request("/permission/invalid-permission-id/reply", {
141+
method: "POST",
142+
body: JSON.stringify({ reply: "once" }),
143+
}),
144+
request("/question/invalid-question-id/reply", {
145+
method: "POST",
146+
body: JSON.stringify({ answers: [["Yes"]] }),
147+
}),
142148
request("/question/invalid-question-id/reject", { method: "POST" }),
143149
],
144150
{ concurrency: "unbounded" },

packages/sdk/openapi.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9057,7 +9057,8 @@
90579057
"type": "object",
90589058
"properties": {
90599059
"id": {
9060-
"type": "string"
9060+
"type": "string",
9061+
"pattern": "^per"
90619062
},
90629063
"sessionID": {
90639064
"type": "string"
@@ -9355,7 +9356,8 @@
93559356
"type": "object",
93569357
"properties": {
93579358
"id": {
9358-
"type": "string"
9359+
"type": "string",
9360+
"pattern": "^que"
93599361
},
93609362
"sessionID": {
93619363
"type": "string"
@@ -9387,7 +9389,8 @@
93879389
"type": "string"
93889390
},
93899391
"requestID": {
9390-
"type": "string"
9392+
"type": "string",
9393+
"pattern": "^que"
93919394
},
93929395
"answers": {
93939396
"type": "array",
@@ -9406,7 +9409,8 @@
94069409
"type": "string"
94079410
},
94089411
"requestID": {
9409-
"type": "string"
9412+
"type": "string",
9413+
"pattern": "^que"
94109414
}
94119415
},
94129416
"required": ["sessionID", "requestID"],
@@ -15815,7 +15819,8 @@
1581515819
"type": "string"
1581615820
},
1581715821
"requestID": {
15818-
"type": "string"
15822+
"type": "string",
15823+
"pattern": "^per"
1581915824
},
1582015825
"reply": {
1582115826
"type": "string",

0 commit comments

Comments
 (0)