summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-09docs: update ADR-002 for parent-subtask BLOCKED→READY state behaviorClaudomator Agent
- Transition table: add BLOCKED→READY (trigger: all subtasks COMPLETED) - Transition table: clarify RUNNING→READY only when no subtasks exist - Transition table: add RUNNING→BLOCKED for parent-with-subtasks path - Execution outcome mapping: reflect subtask check - State diagram: show BLOCKED→READY arc - Key Invariants: add #7 parent-with-subtasks goes BLOCKED on runner exit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: log errors from all unchecked UpdateTaskState/UpdateTaskQuestion callsClaudomator Agent
All previously ignored errors from p.store.UpdateTaskState() and p.store.UpdateTaskQuestion() in execute() and executeResume() now log with structured context (taskID, state, error). Introduces a Store interface so tests can inject a failing mock store. Adds TestPool_UpdateTaskState_DBError_IsLoggedAndResultDelivered to verify that a DB write failure is logged and the result is still delivered to resultCh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09storage: fix DeleteTask atomicity and use recursive CTEClaudomator Agent
Replace BFS loop with a single recursive CTE to collect all descendant task IDs in one query, and wrap all DELETE statements in a transaction so a partial failure cannot leave orphaned executions. Add TestDeleteTask_DeepSubtaskCascadeAtomic: creates a 3-level task hierarchy with executions at each level, deletes the root, and verifies all tasks and executions are removed with an explicit orphan-row check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09storage: add missing indexes and ListRecentExecutions correctness testsClaudomator Agent
Add two schema indexes that were missing: - idx_executions_start_time on executions(start_time): speeds up ListRecentExecutions WHERE start_time >= ? ORDER BY start_time DESC - idx_tasks_parent_task_id on tasks(parent_task_id): speeds up ListSubtasks WHERE parent_task_id = ? Both use CREATE INDEX IF NOT EXISTS so they are safe to apply on existing databases without a migration version bump. Add TestListRecentExecutions_LargeDataset (100 rows, two tasks) covering: - returns all rows in descending start_time order - respects the limit parameter - filters correctly by since time - filters correctly by task_id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: validate ?state= param in handleListTasks; standardize operation ↵Claudomator Agent
response shapes - handleListTasks: validate ?state= against known states, return 400 with clear error for unrecognized values (e.g. ?state=BOGUS) - handleCancelTask: replace {"status":"cancelling"|"cancelled"} with {"message":"...","task_id":"..."} to match run/resume shape - handleAnswerQuestion: replace {"status":"queued"} with {"message":"task queued for resume","task_id":"..."} - Tests: add TestListTasks_InvalidState_Returns400, TestListTasks_ValidState_Returns200, TestCancelTask_ResponseShape, TestAnswerQuestion_ResponseShape, TestRunTask_ResponseShape, TestResumeTimedOut_ResponseShape Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: add configurable mockRunner and async error-path testsClaudomator Agent
Replace the no-op mockRunner in server_test.go with a configurable version that supports err and sleep fields. Add testServerWithRunner helper and a pollState utility for async assertions. Add three new tests that exercise the pool's error paths end-to-end: - TestRunTask_AgentFails_TaskSetToFailed - TestRunTask_AgentTimesOut_TaskSetToTimedOut - TestRunTask_AgentCancelled_TaskSetToCancelled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: document kill-goroutine safety and add goroutine-leak testClaudomator Agent
The pgid-kill goroutine in execOnce() uses a select with both ctx.Done() and the killDone channel. Add a detailed comment explaining why the goroutine cannot block indefinitely: the killDone arm fires unconditionally when cmd.Wait() returns (whether the process exited naturally or was killed), so the goroutine always exits before execOnce() returns. Add TestExecOnce_NoGoroutineLeak_OnNaturalExit to verify this: it samples runtime.NumGoroutine() before and after execOnce() with a no-op binary ("true") and a background context (never cancelled), asserting no net goroutine growth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09task: remove legacy Claude field from Task structClaudomator Agent
2026-03-09scripts: pull latest from bare repo before building in deployPeter Stone
2026-03-09executor: strengthen rate-limit avoidance in classifierPeter Stone
Updated isQuotaExhausted to detect more Claude quota messages. Added 'rate limit reached (rejected)' to quota exhausted checks. Strengthened classifier prompt to explicitly forbid selecting rate-limited agents. Improved Pool to set 5h rate limit on quota exhaustion.
2026-03-09executor: fix sandbox teardown — remove working copy pull, retry push on ↵Peter Stone
concurrent rejection - Remove git pull into project_dir: working copy is the developer workspace and should be pulled manually; www-data can't write to root-owned .git/objects - On non-fast-forward push rejection (concurrent task pushed first), fetch and rebase then retry once instead of failing the entire task
2026-03-09executor: fix map leaks in activePerAgent and rateLimitedClaudomator Agent
activePerAgent: delete zero-count entries after decrement so the map doesn't accumulate stale keys for agent types that are no longer active. rateLimited: delete entries whose deadline has passed when reading them (in both the classifier block and the execute() pre-flight), so stale entries are cleaned up on the next check rather than accumulating forever. Both fixes are covered by new regression tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: make workspace root configurable instead of hardcoded /workspaceClaudomator Agent
- Add workspaceRoot field (default "/workspace") to Server struct - Add SetWorkspaceRoot method on Server - Update handleListWorkspaces to use s.workspaceRoot - Add WorkspaceRoot field to Config with default "/workspace" - Wire cfg.WorkspaceRoot into server in serve.go - Expose --workspace-root flag on the serve command - Add TestListWorkspaces_UsesConfiguredRoot integration test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: update classifier model list to Claude 4.x and current Gemini modelsPeter Stone
2026-03-09web: show model alongside agent type on running task cardsClaudomator Agent
2026-03-09web: show execution id and agent type on running task cardsClaudomator Agent
Each running task card now shows a meta row with the assigned agent type (e.g. "claude" or "gemini") and the short execution ID, which is filled in asynchronously once the execution record is fetched. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: recover stale RUNNING tasks on server startupPeter Stone
On restart, any tasks in RUNNING state have no active goroutine. RecoverStaleRunning() marks them FAILED (retryable) and closes their open execution records with an appropriate error message. Called once from serve.go after the pool is created.
2026-03-09web: skip task list re-render when dialog or panel is openPeter Stone
Prevents periodic poll from clearing the task panel, open modals, or inline edit forms while the user is interacting with them. - isUserEditing() now also detects any open <dialog> or task-panel - poll() checks isUserEditing() before calling destructive renders
2026-03-09test: remove sandbox test output filePeter Stone
2026-03-09test: add sandbox test output fileClaudomator Agent
2026-03-09chore: remove deleted template files from gitPeter Stone
2026-03-09feat: delete templates feature and allow requeueing BUDGET_EXCEEDED tasksPeter Stone
Removed all template-related code from frontend (tabs, modals, logic) and backend (routes, files, DB table). Updated BUDGET_EXCEEDED tasks to be requeueable with a Restart button. Fixed ReferenceError in isUserEditing for Node.js tests.
2026-03-09web: sort Done/Interrupted tabs newest-first and filter Done tab by 24hPeter Stone
Updated sortTasksByDate to support descending sort. Changed renderTaskList to use descending sort for Done and Interrupted tabs. Updated filterTasksByTab to hide Done tasks older than 24 hours by default. Updated frontend tests to match new behavior.
2026-03-09task: allow requeueing BUDGET_EXCEEDED tasksPeter Stone
Permitted BUDGET_EXCEEDED -> QUEUED transition in ValidTransition. Updated frontend to show 'Restart' button for BUDGET_EXCEEDED tasks, allowing them to be requeued after failure.
2026-03-09executor: fix Claude rate-limit detection and prioritize Gemini when limitedPeter Stone
Updated parseStream to detect 'rate_limit_event' and 'assistant' error:rate_limit messages from the Claude CLI. Updated Classifier to strongly prefer non-rate-limited agents. Added logging to Pool to track rate-limit status during classification.
2026-03-08web: include BUDGET_EXCEEDED and BLOCKED in interrupted viewPeter Stone
Moved BUDGET_EXCEEDED and BLOCKED states from DONE and ACTIVE sets to the INTERRUPTED set in the frontend, ensuring they appear in the correct tab.
2026-03-08executor: update gemini model to 2.5-flash-lite and fix classifier parsingPeter Stone
Update the default Gemini model and classification prompt to use gemini-2.5-flash-lite, which is the current available model. Improved the classifier's parsing logic to correctly handle the JSON envelope returned by the gemini CLI (stripping 'response' wrapper and 'Loaded cached credentials' noise).
2026-03-08executor: push sandbox commits via bare repo, pull into working copyPeter Stone
Instead of git fetch/merge INTO the working copy (which fails with mixed-owner .git/objects), clone FROM a bare repo, push BACK to it, then pull into the working copy: sandbox clone ← bare repo (local remote or origin) agent commits in sandbox git push sandbox → bare repo git pull bare repo → working copy sandboxCloneSource() prefers a remote named "local" (local bare repo), then "origin", then falls back to the working copy path. Set up: git remote add local /site/git.terst.org/repos/claudomator.git The bare repo was created with: git clone --bare /workspace/claudomator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08executor: fix sandbox git fetch + inject prior failure historyPeter Stone
Fix: use file:// prefix in git fetch during sandbox teardown to force pack-protocol transfer. The local optimization uses hard links which fail across devices and with mixed-owner object stores. Feature: before running a task, query prior failed/timed-out executions and prepend their error messages to the agent's --append-system-prompt. This tells the agent what went wrong in previous attempts so it doesn't repeat the same mistakes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08task: add BLOCKED→READY to ValidTransitionClaudomator Agent
2026-03-08executor: add git discipline section to agent preamblePeter Stone
Agents running in a sandbox must commit all changes before exiting. The teardown rejects any dirty working tree. Add an explicit section to the planning preamble making this requirement clear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08fix(executor): use --no-hardlinks for sandbox git clonePeter Stone
git clone --local fails with "Invalid cross-device link" when /workspace and /tmp are on different filesystems. --no-hardlinks forces object copying instead, which works across devices. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08fix: retry limits apply only to automatic retries, not manual runsPeter Stone
Remove the MaxAttempts check from POST /api/tasks/{id}/run. A user explicitly triggering a run is a manual action and should not be gated by the retry limit. Retry limits will be enforced in the (future) automatic retry path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08fix: restore task execution broken by add-gemini mergePeter Stone
- handleCreateTask: add legacy "claude" key fallback in input struct so old clients and YAML files sending claude:{...} still work - cli/create: send "agent" key instead of "claude"; add --agent-type flag - storage/db_test: fix ClaudeConfig → AgentConfig after rename Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08fix(cli): register scripts in serve commandPeter Stone
Restore the script registry in internal/cli/serve.go which was lost during the gemini merge. This fixes the 'Start Next Task' button in the web UI which relies on the /api/scripts/start-next-task endpoint.
2026-03-08feat(web): remove Agent and Model selection from UIPeter Stone
As the system now automatically classifies and assigns the best agent and model per task, manual selection is no longer required and has been removed from New Task, Edit Task, and Template forms.
2026-03-08fix(web): resolve merge conflicts and fix tab navigationPeter Stone
- Remove unresolved merge markers in app.js. - Set 'tasks' as the default active tab and panel on boot. - Synchronize initial HTML state with JS tab switching logic. - Fix broken Draft with AI button handler from bad merge.
2026-03-08merge: pull latest from master and resolve conflictsPeter Stone
- Resolve conflicts in API server, CLI, and executor. - Maintain Gemini classification and assignment logic. - Update UI to use generic agent config and project_dir. - Fix ProjectDir/WorkingDir inconsistencies in Gemini runner. - All tests passing after merge.
2026-03-08feat(executor): implement Gemini-based task classification and load balancingPeter Stone
- Add Classifier using gemini-2.0-flash-lite to automatically select agent/model. - Update Pool to track per-agent active tasks and rate limit status. - Enable classification for all tasks (top-level and subtasks). - Refine SystemStatus to be dynamic across all supported agents. - Add unit tests for the classifier and updated pool logic. - Minor UI improvements for project selection and 'Start Next' action.
2026-03-08docs: add ADR 003 security modelPeter Stone
Documents the trust boundary, API token auth, per-IP rate limiting, WebSocket client cap, and known risks for the Claudomator security posture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08web/test: add active-pane, focus-preserve, is-user-editing, render-dedup testsPeter Stone
Unit tests for UI helper functions: active pane detection, input focus preservation during polls, user-editing guard, and render deduplication. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08web/test: add Interrupted tab filter testsPeter Stone
Tests for the INTERRUPTED_STATES set (CANCELLED, FAILED) and the filterInterruptedTasks helper used by the Interrupted tab. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08go.mod: add BurntSushi/toml dependencyPeter Stone
Required by config package for TOML config file parsing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08cli: newLogger helper, defaultServerURL, shared http client, report commandPeter Stone
- Extract newLogger() to remove duplication across run/serve/start - Add defaultServerURL const ("http://localhost:8484") used by all client commands - Move http.Client into internal/cli/http.go with 30s timeout - Add 'report' command for printing execution summaries - Add test coverage for create and serve commands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08config: Default() returns errorPeter Stone
Default() now returns (*Config, error) so callers can detect TOML parse failures rather than silently falling back to zero values. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08api: extend executions and log streaming endpointsPeter Stone
- handleListRecentExecutions: add since/limit/task_id query params - handleStreamLogs: tighten SSE framing and cleanup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08api: SetAPIToken, SetNotifier, questionStore, per-IP rate limiterPeter Stone
- Extract questionStore interface for testability of handleAnswerQuestion - Add SetAPIToken/SetNotifier methods for post-construction wiring - Extract processResult() from forwardResults() for direct testability - Add ipRateLimiter with token-bucket per IP; applied to /elaborate and /validate - Fix tests for running-task deletion and retry-limit that relied on invalid state transitions in setup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08api: generic ScriptRegistry; collapse script endpointsPeter Stone
Replace hardcoded handleStartNextTask/handleDeploy with a single handleScript handler keyed by name from a ScriptRegistry map. Scripts are now configured via Server.SetScripts() rather than individual setter fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08api: WebSocket auth, client cap, and ping keepalivePeter Stone
- Require bearer token on WebSocket connections when apiToken is set - Cap concurrent WebSocket clients at maxWsClients (1000, overridable) - Send periodic pings every 30s; close dead connections after 10s write deadline Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08executor: internal dispatch queue; remove at-capacity rejectionPeter Stone
Replace the at-capacity error return from Submit/SubmitResume with an internal workCh/doneCh channel pair. A dispatch() goroutine blocks waiting for a free slot and launches the worker goroutine, so tasks are buffered up to 10x pool capacity instead of being rejected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>