Skip to content

Add Ralph todo-config (maxTodos / todoExpirationMinutes)#135

Merged
Ark0N merged 1 commit into
Ark0N:masterfrom
aakhter:cod-79-ralph-todo-config
Jun 24, 2026
Merged

Add Ralph todo-config (maxTodos / todoExpirationMinutes)#135
Ark0N merged 1 commit into
Ark0N:masterfrom
aakhter:cod-79-ralph-todo-config

Conversation

@aakhter

@aakhter aakhter commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes the Ralph autonomous loop's todo handling configurable through the existing ralph-config route, rather than using hardcoded values.

  • Adds maxTodos and todoExpirationMinutes to the ralph-config schema.
  • Wires both values through the ralph-config route to the tracker via setMaxTodos() / setTodoExpirationMinutes().

Files

src/ralph-tracker.ts, src/web/routes/ralph-routes.ts, src/web/schemas.ts, test/routes/ralph-routes.test.ts.

Testing

  • tsc --noEmit: clean
  • test/routes/ralph-routes.test.ts: 34/34
  • npm run build: passes

…g to the tracker

The Ralph settings modal sent maxTodos/todoExpirationMinutes but RalphConfigSchema
(zod) stripped them and the ralph-config route never applied them, so the inputs
were silent no-ops.

Fix: add both as optional positive-int fields to RalphConfigSchema; destructure
and apply them in the ralph-config route (matching the maxIterations pattern).
RalphTracker had no setters (the values were module constants) — added per-instance
_maxTodos/_todoExpiryMs (defaulting to the same constants, behavior unchanged),
switched the eviction + expiry sites to read them, and added
setMaxTodos/setTodoExpirationMinutes (minutes→ms) + getters.

Test: route test POSTs the two fields and asserts the route applies them to the
tracker. Verified RED (setters not called — fields stripped) → GREEN. 34/34
ralph-routes tests pass; tsc + eslint(src) + prettier + build clean. Frontend
already sent the fields (no change).
@Ark0N Ark0N merged commit c2867be into Ark0N:master Jun 24, 2026
2 checks passed
Ark0N pushed a commit that referenced this pull request Jun 24, 2026
Gemini (PR #134) blockers:
- runGemini() now unwraps the {success,data} envelope: status check reads
  .data.available, quick-start reads data.data.sessionId (was reading the raw
  shape, so the Run-Gemini button could never start a session).
- setGeminiEnvVars() now uses the socket-scoped ${this.tmux()} setenv instead of
  bare tmux — Gemini/Google auth env vars were targeting the wrong tmux server
  and silently failing on every install.

Gemini parity polish:
- gemini tab-mode badge ('gm') + .tab-mode.gemini CSS; kill-dialog label
  'Kill Tmux & Gemini'; codeman doctor dependency-registry entry; export
  isGeminiAvailable from utils barrel; COLORTERM=truecolor + unset NO_COLOR;
  add gemini to isAltScreenStripMode (Ink TUI, repaints inline like Codex/Claude).
- Revert 4 system-routes.test.ts envelope assertions weakened to
  (body.message ?? body.error) back to (body.success === false).
- Add a runGemini() vm-sandbox test that drives the envelope path end-to-end.

Ralph todo-config (PR #135): maxTodos/todoExpirationMinutes are now persisted
and read back — surfaced via the loopState getter (RalphTrackerState) into
toState()/SSE broadcast and restored in restoreState(), mirroring maxIterations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants