altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

run: wrapper orphans the binary on SIGTERM, agent config keys fold silently, no token budget

Open RaghwendraSingh opened this issue 1 month ago • 1 comments

Problem

Three gaps make a headless altimate-code run hard to bound and stop from a driver script:

  • Killing the wrapper orphans the binary. bin/altimate-code runs the compiled binary with spawnSync, which installs no signal handling. kill <wrapper pid> (SIGTERM from a harness, timeout, a CI cancel) ends the Node wrapper and leaves the binary running with no parent. Observed: a run kept working and spending tokens after its driver had killed the wrapper at its budget.
  • Unknown agent config keys are folded into options without a word. ConfigAgentV1.normalize copies every top-level key it does not interpret into options. A typo such as budget: 30 for steps: 30 is accepted, does nothing, and leaves no trace in the log.
  • run has no token budget. --max-turns and --time-budget bound turns and wall-clock time, but nothing bounds billed tokens, and task subagent sessions spend outside the root session's turn count.

Expected

  • Termination signals sent to the wrapper reach the binary; exit codes stay as they are.
  • A folded agent key is at least reported.
  • An optional --max-tokens <n> stops the run (root and task sessions together) and finalizes it the same way --time-budget does. Without the flag nothing changes.

RaghwendraSingh avatar Nov 04 '26 10:11 RaghwendraSingh

Duplicate of #1653 (opened by mistake; PR #1655 already tracks this).

RaghwendraSingh avatar Nov 04 '26 10:11 RaghwendraSingh