refactor: consolidate chat state and task bridges
Centralize session scope, chat projections and typed task bridges. Keep historical interaction replies authoritative and publish terminal state to subscribers. Validate Server contracts before replacing generated artifacts.
This commit is contained in:
@@ -381,13 +381,6 @@ export class OpencodeRuntimeAdapter {
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
async sendPrompt(sessionId: string, text: string) {
|
||||
await this.prompt(sessionId, text);
|
||||
// 当前 SDK 响应风格下,prompt() 本身不会直接返回完整 assistant parts,
|
||||
// 所以这里紧跟一次 messages() 回读,给上层路由统一消费。
|
||||
return this.messages(sessionId);
|
||||
}
|
||||
|
||||
async generateText(prompt: string, model?: RuntimeModelOverride, signal?: AbortSignal) {
|
||||
const client = await this.ensureClient();
|
||||
const selected = model ?? parseModelReference(config.OPENCODE_MODEL);
|
||||
|
||||
Reference in New Issue
Block a user