chore: generate

This commit is contained in:
opencode-agent[bot]
2026-05-21 04:02:29 +00:00
parent 14366af069
commit 7a554441b4
2 changed files with 114 additions and 116 deletions
+4 -1
View File
@@ -119,7 +119,10 @@ export async function tmpdir<T>(options?: TmpDirOptions<T>) {
} }
/** Effectful scoped tmpdir. Cleaned up when the scope closes. Make sure these stay in sync */ /** Effectful scoped tmpdir. Cleaned up when the scope closes. Make sure these stay in sync */
export function tmpdirScoped(options?: { git?: boolean; config?: Partial<Config.Info> | (() => Partial<Config.Info>) }) { export function tmpdirScoped(options?: {
git?: boolean
config?: Partial<Config.Info> | (() => Partial<Config.Info>)
}) {
return Effect.gen(function* () { return Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner const spawner = yield* ChildProcessSpawner.ChildProcessSpawner
const dirpath = sanitizePath(path.join(os.tmpdir(), "opencode-test-" + Math.random().toString(36).slice(2))) const dirpath = sanitizePath(path.join(os.tmpdir(), "opencode-test-" + Math.random().toString(36).slice(2)))
+110 -115
View File
@@ -916,47 +916,47 @@ describe("session.llm.stream", () => {
const model = loadFixture("openai", "gpt-5.2").model const model = loadFixture("openai", "gpt-5.2").model
const responseChunks = [ const responseChunks = [
{ {
type: "response.created", type: "response.created",
response: { response: {
id: "resp-1", id: "resp-1",
created_at: Math.floor(Date.now() / 1000), created_at: Math.floor(Date.now() / 1000),
model: model.id, model: model.id,
service_tier: null, service_tier: null,
}, },
},
{
type: "response.output_item.added",
output_index: 0,
item: { type: "message", id: "item-1", status: "in_progress", role: "assistant", content: [] },
},
{
type: "response.content_part.added",
item_id: "item-1",
output_index: 0,
content_index: 0,
part: { type: "output_text", text: "", annotations: [] },
},
{
type: "response.output_text.delta",
item_id: "item-1",
delta: "Hello",
logprobs: null,
},
{
type: "response.completed",
response: {
incomplete_details: null,
usage: {
input_tokens: 1,
input_tokens_details: null,
output_tokens: 1,
output_tokens_details: null,
}, },
service_tier: null, {
}, type: "response.output_item.added",
}, output_index: 0,
] item: { type: "message", id: "item-1", status: "in_progress", role: "assistant", content: [] },
},
{
type: "response.content_part.added",
item_id: "item-1",
output_index: 0,
content_index: 0,
part: { type: "output_text", text: "", annotations: [] },
},
{
type: "response.output_text.delta",
item_id: "item-1",
delta: "Hello",
logprobs: null,
},
{
type: "response.completed",
response: {
incomplete_details: null,
usage: {
input_tokens: 1,
input_tokens_details: null,
output_tokens: 1,
output_tokens_details: null,
},
service_tier: null,
},
},
]
const request = waitRequest("/responses", createEventResponse(responseChunks, true)) const request = waitRequest("/responses", createEventResponse(responseChunks, true))
const resolved = yield* Provider.use.getModel(ProviderID.openai, ModelID.make(model.id)) const resolved = yield* Provider.use.getModel(ProviderID.openai, ModelID.make(model.id))
@@ -1481,41 +1481,41 @@ describe("session.llm.stream", () => {
const model = loadFixture(minimaxFixture.providerID, minimaxFixture.modelID).model const model = loadFixture(minimaxFixture.providerID, minimaxFixture.modelID).model
const chunks = [ const chunks = [
{ {
type: "message_start", type: "message_start",
message: { message: {
id: "msg-1", id: "msg-1",
model: model.id, model: model.id,
usage: { usage: {
input_tokens: 3, input_tokens: 3,
cache_creation_input_tokens: null, cache_creation_input_tokens: null,
cache_read_input_tokens: null, cache_read_input_tokens: null,
},
},
}, },
}, {
}, type: "content_block_start",
{ index: 0,
type: "content_block_start", content_block: { type: "text", text: "" },
index: 0, },
content_block: { type: "text", text: "" }, {
}, type: "content_block_delta",
{ index: 0,
type: "content_block_delta", delta: { type: "text_delta", text: "Hello" },
index: 0, },
delta: { type: "text_delta", text: "Hello" }, { type: "content_block_stop", index: 0 },
}, {
{ type: "content_block_stop", index: 0 }, type: "message_delta",
{ delta: { stop_reason: "end_turn", stop_sequence: null, container: null },
type: "message_delta", usage: {
delta: { stop_reason: "end_turn", stop_sequence: null, container: null }, input_tokens: 3,
usage: { output_tokens: 2,
input_tokens: 3, cache_creation_input_tokens: null,
output_tokens: 2, cache_read_input_tokens: null,
cache_creation_input_tokens: null, },
cache_read_input_tokens: null, },
}, { type: "message_stop" },
}, ]
{ type: "message_stop" },
]
const request = waitRequest("/messages", createEventResponse(chunks)) const request = waitRequest("/messages", createEventResponse(chunks))
const resolved = yield* Provider.use.getModel( const resolved = yield* Provider.use.getModel(
@@ -1578,41 +1578,41 @@ describe("session.llm.stream", () => {
Effect.gen(function* () { Effect.gen(function* () {
const model = loadFixture("anthropic", "claude-opus-4-6").model const model = loadFixture("anthropic", "claude-opus-4-6").model
const chunks = [ const chunks = [
{ {
type: "message_start", type: "message_start",
message: { message: {
id: "msg-tool-order", id: "msg-tool-order",
model: model.id, model: model.id,
usage: { usage: {
input_tokens: 3, input_tokens: 3,
cache_creation_input_tokens: null, cache_creation_input_tokens: null,
cache_read_input_tokens: null, cache_read_input_tokens: null,
},
},
}, },
}, {
}, type: "content_block_start",
{ index: 0,
type: "content_block_start", content_block: { type: "text", text: "" },
index: 0, },
content_block: { type: "text", text: "" }, {
}, type: "content_block_delta",
{ index: 0,
type: "content_block_delta", delta: { type: "text_delta", text: "ok" },
index: 0, },
delta: { type: "text_delta", text: "ok" }, { type: "content_block_stop", index: 0 },
}, {
{ type: "content_block_stop", index: 0 }, type: "message_delta",
{ delta: { stop_reason: "end_turn", stop_sequence: null, container: null },
type: "message_delta", usage: {
delta: { stop_reason: "end_turn", stop_sequence: null, container: null }, input_tokens: 3,
usage: { output_tokens: 2,
input_tokens: 3, cache_creation_input_tokens: null,
output_tokens: 2, cache_read_input_tokens: null,
cache_creation_input_tokens: null, },
cache_read_input_tokens: null, },
}, { type: "message_stop" },
}, ]
{ type: "message_stop" },
]
const request = waitRequest("/messages", createEventResponse(chunks)) const request = waitRequest("/messages", createEventResponse(chunks))
const resolved = yield* Provider.use.getModel(ProviderID.make("anthropic"), ModelID.make(model.id)) const resolved = yield* Provider.use.getModel(ProviderID.make("anthropic"), ModelID.make(model.id))
@@ -1808,18 +1808,13 @@ describe("session.llm.stream", () => {
const chunks = [ const chunks = [
{ {
candidates: [ candidates: [{ content: { parts: [{ text: "Hello" }] }, finishReason: "STOP" }],
{ content: { parts: [{ text: "Hello" }] }, finishReason: "STOP" },
],
usageMetadata: { promptTokenCount: 1, candidatesTokenCount: 1, totalTokenCount: 2 }, usageMetadata: { promptTokenCount: 1, candidatesTokenCount: 1, totalTokenCount: 2 },
}, },
] ]
const request = waitRequest(pathSuffix, createEventResponse(chunks)) const request = waitRequest(pathSuffix, createEventResponse(chunks))
const resolved = yield* Provider.use.getModel( const resolved = yield* Provider.use.getModel(ProviderID.make(geminiFixture.providerID), ModelID.make(model.id))
ProviderID.make(geminiFixture.providerID),
ModelID.make(model.id),
)
const sessionID = SessionID.make("session-test-4") const sessionID = SessionID.make("session-test-4")
const agent = { const agent = {
name: "test", name: "test",