opencode-agent[bot] пре 3 месеци
родитељ
комит
29b1060c67

+ 7 - 4
packages/opencode/src/server/routes/instance/httpapi/server.ts

@@ -69,10 +69,13 @@ const runtime = HttpRouter.middleware()(
   ),
 ).layer
 
-const cors = HttpRouter.middleware(HttpMiddleware.cors({
-  allowedOrigins: isAllowedCorsOrigin,
-  maxAge: 86_400,
-}), { global: true })
+const cors = HttpRouter.middleware(
+  HttpMiddleware.cors({
+    allowedOrigins: isAllowedCorsOrigin,
+    maxAge: 86_400,
+  }),
+  { global: true },
+)
 
 const rootApiRoutes = HttpApiBuilder.layer(RootHttpApi).pipe(Layer.provide([controlHandlers, globalHandlers]))
 const instanceApiRoutes = HttpApiBuilder.layer(InstanceHttpApi).pipe(

+ 3 - 1
packages/opencode/test/server/httpapi-instance-context.test.ts

@@ -214,7 +214,9 @@ describe("HttpApi instance context middleware", () => {
       yield* serveDisposeProbe()
       const disposed = yield* waitDisposedEvent.pipe(Effect.forkScoped)
 
-      const response = yield* HttpClientRequest.post(`/dispose-probe?workspace=${workspace.id}`).pipe(HttpClient.execute)
+      const response = yield* HttpClientRequest.post(`/dispose-probe?workspace=${workspace.id}`).pipe(
+        HttpClient.execute,
+      )
 
       expect(response.status).toBe(200)
       expect(yield* response.json).toBe(true)

+ 1 - 6
packages/opencode/test/server/httpapi-mcp-oauth.test.ts

@@ -47,12 +47,7 @@ const passthroughInstanceContext = Layer.succeed(
 const testWorkspaceRouting = Layer.succeed(
   WorkspaceRoutingMiddleware,
   WorkspaceRoutingMiddleware.of((effect) =>
-    effect.pipe(
-      Effect.provideService(
-        WorkspaceRouteContext,
-        WorkspaceRouteContext.of({ directory: process.cwd() }),
-      ),
-    ),
+    effect.pipe(Effect.provideService(WorkspaceRouteContext, WorkspaceRouteContext.of({ directory: process.cwd() }))),
   ),
 )
 

+ 9 - 5
packages/opencode/test/server/httpapi-session.test.ts

@@ -235,11 +235,15 @@ describe("session HttpApi", () => {
         const effect = yield* createSession(tmp.path, { title: "effect" })
         const body = JSON.stringify({ time: { archived: -1 } })
 
-        const legacyResponse = yield* requestWithBackend(false, pathFor(SessionPaths.update, { sessionID: legacy.id }), {
-          method: "PATCH",
-          headers,
-          body,
-        })
+        const legacyResponse = yield* requestWithBackend(
+          false,
+          pathFor(SessionPaths.update, { sessionID: legacy.id }),
+          {
+            method: "PATCH",
+            headers,
+            body,
+          },
+        )
         expect(legacyResponse.status).toBe(200)
         expect((yield* json<Session.Info>(legacyResponse)).time.archived).toBe(-1)
 

+ 3 - 9
packages/sdk/openapi.json

@@ -10341,9 +10341,7 @@
                 "maximum": 9007199254740991
               },
               "archived": {
-                "type": "integer",
-                "minimum": 0,
-                "maximum": 9007199254740991
+                "type": "number"
               }
             },
             "required": ["created", "updated"]
@@ -10854,9 +10852,7 @@
                       "archived": {
                         "anyOf": [
                           {
-                            "type": "integer",
-                            "minimum": 0,
-                            "maximum": 9007199254740991
+                            "type": "number"
                           },
                           {
                             "type": "null"
@@ -12773,9 +12769,7 @@
                 "maximum": 9007199254740991
               },
               "archived": {
-                "type": "integer",
-                "minimum": 0,
-                "maximum": 9007199254740991
+                "type": "number"
               }
             },
             "required": ["created", "updated"]