GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): one greedy agent process no longer takes down the whole … · patroza/t3code@ba9c9ae

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/cloud
    • bootService.test.ts
    • bootService.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/cloud/bootService.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/cloud/bootService.test.ts
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ it("keeps systemd pinned to the stable launcher rather than a versioned server",
3535
expect(unit).not.toContain("versions/1.2.3");
3636
});
3737

38+
it("survives the kernel OOM-killing a greedy agent child", () => {
39+
const unit = BootService.renderBootServiceUnit({
40+
nodePath: "/usr/bin/node",
41+
launcherPath: "/home/theo/.t3/runtime/service-launcher.mjs",
42+
baseDir: "/home/theo/.t3",
43+
logPath: "/home/theo/.t3/userdata/logs/boot-service.log",
44+
unitPath: "/home/theo/.config/systemd/user/t3code.service",
45+
});
46+
47+
expect(unit).toContain("OOMPolicy=continue");
48+
});
49+
3850
const makeHarness = Effect.fn("test.make_boot_service_harness")(function* (
3951
platform: NodeJS.Platform = "linux",
4052
usePinnedLauncher = false,
Collapse file

‎apps/server/src/cloud/bootService.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/cloud/bootService.ts
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export function renderBootServiceUnit(plan: BootServicePlan): string {
6767
// Let the launcher mark an explicit stop before it signals the server.
6868
// systemd still SIGKILLs the whole cgroup if graceful shutdown times out.
6969
"KillMode=mixed",
70+
// Agent tool calls run as children of the server, so they share this cgroup.
71+
// With the systemd default of OOMPolicy=stop, the kernel killing one greedy
72+
// child stops the whole unit: the server, every live agent, and the user's
73+
// connection. Keep running and let Restart=always cover the main process.
74+
"OOMPolicy=continue",
7075
"Restart=always",
7176
"RestartSec=5",
7277
`StandardOutput=append:${escapeSystemdSpecifiers(plan.logPath)}`,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.