add automatic heap snapshots for high-memory cli processes (#20788)

This commit is contained in:
Dax
2026-04-02 22:34:33 -04:00
committed by GitHub
parent 8daeacc989
commit aa2239d5de
4 changed files with 66 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ import { JsonMigration } from "./storage/json-migration"
import { Database } from "./storage/db"
import { errorMessage } from "./util/error"
import { PluginCommand } from "./cli/cmd/plug"
import { Heap } from "./cli/heap"
process.on("unhandledRejection", (e) => {
Log.Default.error("rejection", {
@@ -96,6 +97,8 @@ const cli = yargs(args)
})(),
})
Heap.start()
process.env.AGENT = "1"
process.env.OPENCODE = "1"
process.env.OPENCODE_PID = String(process.pid)