fix(opencode): restore stable v1 runtime

This commit is contained in:
2026-08-05 17:59:35 +08:00
parent 764a1f4e82
commit 1407dd3bbe
33 changed files with 1106 additions and 1668 deletions
+11 -2
View File
@@ -54,6 +54,8 @@ app.get("/health", async (_req, res) => {
const runtime = await opencodeRuntime.health();
res.json({
ok: true,
ready: true,
warmed_up: true,
runtime,
sessions: sessionBridge.count(),
});
@@ -61,6 +63,8 @@ app.get("/health", async (_req, res) => {
const detail = error instanceof Error ? error.message : String(error);
res.status(503).json({
ok: false,
ready: false,
warmed_up: true,
message: "opencode runtime unavailable",
detail,
sessions: sessionBridge.count(),
@@ -520,7 +524,12 @@ resultReferenceStore.startCleanupLoop();
const server = app.listen(config.PORT, config.HOST, () => {
logger.info(
{ host: config.HOST, port: config.PORT },
{
host: config.HOST,
port: config.PORT,
ready: true,
warmedUp: true,
},
"TJWaterAgent listening",
);
});
@@ -529,7 +538,7 @@ const shutdown = async () => {
logger.info("shutting down TJWaterAgent");
server.close();
resultReferenceStore.stopCleanupLoop();
// 同步关闭 embedded OpenCode V2 service,避免本服务退出后留下孤儿进程。
// 同步关闭 embedded opencode server,避免本服务退出后留下孤儿进程。
await opencodeRuntime.dispose();
};