summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-05-28 15:40:35 -0400
committerDax Raad <[email protected]>2025-05-28 15:40:35 -0400
commit6cf4b7f00beb2425dfe5ae11fd42d758edca4ac1 (patch)
tree29c162184d6f3f8d2fea5342e2cac5a0e33f07bd
parent6183398543bbd3ff9d23c5ba2ee40149c9ac7b68 (diff)
downloadopencode-6cf4b7f00beb2425dfe5ae11fd42d758edca4ac1.tar.gz
opencode-6cf4b7f00beb2425dfe5ae11fd42d758edca4ac1.zip
sync
-rw-r--r--js/src/session/session.ts11
-rw-r--r--pkg/client/gen/openapi.json50
-rw-r--r--pkg/client/generated-client.go36
3 files changed, 11 insertions, 86 deletions
diff --git a/js/src/session/session.ts b/js/src/session/session.ts
index 197d4d398..6c89457a5 100644
--- a/js/src/session/session.ts
+++ b/js/src/session/session.ts
@@ -30,12 +30,6 @@ export namespace Session {
id: Identifier.schema("session"),
shareID: z.string().optional(),
title: z.string(),
- cost: z.number().optional(),
- tokens: z.object({
- input: z.number(),
- output: z.number(),
- reasoning: z.number(),
- }),
});
export type Info = z.output<typeof Info>;
@@ -72,11 +66,6 @@ export namespace Session {
const result: Info = {
id: Identifier.descending("session"),
title: "New Session - " + new Date().toISOString(),
- tokens: {
- input: 0,
- output: 0,
- reasoning: 0,
- },
};
log.info("created", result);
state().sessions.set(result.id, result);
diff --git a/pkg/client/gen/openapi.json b/pkg/client/gen/openapi.json
index 3c847affc..3480a1130 100644
--- a/pkg/client/gen/openapi.json
+++ b/pkg/client/gen/openapi.json
@@ -121,34 +121,11 @@
},
"title": {
"type": "string"
- },
- "cost": {
- "type": "number"
- },
- "tokens": {
- "type": "object",
- "properties": {
- "input": {
- "type": "number"
- },
- "output": {
- "type": "number"
- },
- "reasoning": {
- "type": "number"
- }
- },
- "required": [
- "input",
- "output",
- "reasoning"
- ]
}
},
"required": [
"id",
- "title",
- "tokens"
+ "title"
]
}
}
@@ -285,34 +262,11 @@
},
"title": {
"type": "string"
- },
- "cost": {
- "type": "number"
- },
- "tokens": {
- "type": "object",
- "properties": {
- "input": {
- "type": "number"
- },
- "output": {
- "type": "number"
- },
- "reasoning": {
- "type": "number"
- }
- },
- "required": [
- "input",
- "output",
- "reasoning"
- ]
}
},
"required": [
"id",
- "title",
- "tokens"
+ "title"
]
},
"Session.Message": {
diff --git a/pkg/client/generated-client.go b/pkg/client/generated-client.go
index 51552b8f2..45b4762d3 100644
--- a/pkg/client/generated-client.go
+++ b/pkg/client/generated-client.go
@@ -44,15 +44,9 @@ type ProviderInfo struct {
// SessionInfo defines model for Session.Info.
type SessionInfo struct {
- Cost *float32 `json:"cost,omitempty"`
- Id string `json:"id"`
- ShareID *string `json:"shareID,omitempty"`
- Title string `json:"title"`
- Tokens struct {
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- Reasoning float32 `json:"reasoning"`
- } `json:"tokens"`
+ Id string `json:"id"`
+ ShareID *string `json:"shareID,omitempty"`
+ Title string `json:"title"`
}
// SessionMessage defines model for Session.Message.
@@ -1156,15 +1150,9 @@ type PostSessionListResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]struct {
- Cost *float32 `json:"cost,omitempty"`
- Id string `json:"id"`
- ShareID *string `json:"shareID,omitempty"`
- Title string `json:"title"`
- Tokens struct {
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- Reasoning float32 `json:"reasoning"`
- } `json:"tokens"`
+ Id string `json:"id"`
+ ShareID *string `json:"shareID,omitempty"`
+ Title string `json:"title"`
}
}
@@ -1443,15 +1431,9 @@ func ParsePostSessionListResponse(rsp *http.Response) (*PostSessionListResponse,
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []struct {
- Cost *float32 `json:"cost,omitempty"`
- Id string `json:"id"`
- ShareID *string `json:"shareID,omitempty"`
- Title string `json:"title"`
- Tokens struct {
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- Reasoning float32 `json:"reasoning"`
- } `json:"tokens"`
+ Id string `json:"id"`
+ ShareID *string `json:"shareID,omitempty"`
+ Title string `json:"title"`
}
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err