summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2 daysfix: update deploy script to pull from main instead of masterPeter Stone
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 daysfeat: add ct-submit script for permission-free task creationPeter Stone
Wraps POST /api/tasks + run in a single script callable from /workspace/** (auto-permitted). Used by the ct-create skill to avoid per-call auth prompts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 daysfix: set credentials readable by www-data (group 640) in sync-credentialsPeter Stone
7 daysfix: copy .claude.json (account settings) alongside credentialsPeter Stone
ClaudeConfigDir moved from /root/.claude to credentials/claude/, but container.go was still deriving .claude.json from filepath.Dir which no longer pointed anywhere useful. Claude CLI needs .claude.json for OAuth account info or it says "Not logged in". Also update sync-credentials to copy /root/.claude.json into the credentials dir so it stays fresh alongside the token. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7 daysfeat: Phase 2 — project registry, legacy field cleanup, credential path fixPeter Stone
- task.Project type + storage CRUD + UpsertProject + SeedProjects - Remove AgentConfig.ProjectDir, RepositoryURL, SkipPlanning - Remove ContainerRunner fallback git init logic - Project API endpoints: GET/POST /api/projects, GET/PUT /api/projects/{id} - processResult no longer extracts changestats (pool-side only) - claude_config_dir config field; default to credentials/claude/ - New scripts: sync-credentials, fix-permissions, check-token Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7 daysfeat: add cancel and cancel-all-failed to ct-taskPeter Stone
Adds ct-task cancel <prefix> (works from any state, falls back to direct DB update for terminal states) and ct-task cancel-all-failed to clear out stuck FAILED tasks in bulk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7 dayschore: delegate permissions and credential sync to scripts in deployPeter Stone
Replace hardcoded chown/chmod lines with fix-permissions and sync-credentials scripts, keeping deploy DRY and ensuring credentials are always fresh after each deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 dayschore: improve debug-execution script and add ADR-007Peter Stone
- debug-execution: default to most recent execution when no ID given - docs/adr/007: planning layer and story model design decisions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 daysfeat: containerized execution with agent tooling and deployment fixesPeter Stone
- ContainerRunner replaces ClaudeRunner/GeminiRunner; all agent types run in Docker containers via claudomator-agent:latest - Writable agentHome staging dir (/home/agent) satisfies home-dir requirements for both claude and gemini CLIs without exposing host creds - Copy .credentials.json and .claude.json into staging dir at run time; GEMINI_API_KEY passed via env file - Fix git clone: remove MkdirTemp-created dir before cloning (git rejects pre-existing dirs even when empty) - Replace localhost with host.docker.internal in APIURL so container can reach host API; add --add-host=host.docker.internal:host-gateway - Run container as --user=$(uid):$(gid) so host-owned workspace files are readable; chmod workspace 0755 and instructions file 0644 after clone - Pre-create .gemini/ in staging dir to avoid atomic-rename ENOENT on first gemini-cli run - Add ct CLI tool to container image: pre-built Bash wrapper for Claudomator API (ct task submit/create/run/wait/status/list) - Document ct tool in CLAUDE.md agent instructions section - Add drain-failed-tasks script: retries failed tasks on a 5-minute interval - Update Dockerfile: Node 22 via NodeSource, Go 1.24, gemini-cli, git safe.directory=*, default ~/.claude.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix: prefix SW registration path with BASE_PATHPeter Stone
The app is served at /claudomator/ so the SW and scope must use BASE_PATH + '/api/push/sw.js' and BASE_PATH + '/' respectively. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix: deploy script skips scripts/hooks/ subdirectory when copyingPeter Stone
cp without -r fails on directories. Use find -maxdepth 1 -type f to copy only files, since hooks/ is for local dev only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix: repair test regressions and add pre-commit/pre-push verification gatesPeter Stone
Fix four pre-existing bugs exposed after resolving a build failure: - sandboxCloneSource: accept any URL scheme for origin remote (was filtering out https://) - setupSandbox callers: fix := shadow variable so sandboxDir is set on BlockedError - parseGeminiStream: parse result lines to return execution errors and cost - TestElaborateTask_InvalidJSONFromClaude: stub Gemini fallback so test is hermetic Add verification infrastructure: - scripts/verify: runs go build + go test -race, used by hooks and deploy - scripts/hooks/pre-commit: blocks commits that don't compile - scripts/hooks/pre-push: blocks pushes where tests fail - scripts/install-hooks: symlinks version-controlled hooks into .git/hooks/ - scripts/deploy: runs scripts/verify before building the binary Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfeat: improve next-task selection and rejection UXPeter Stone
- next-task script: exclude rejected tasks from fallback selection; only pick PENDING tasks with no rejection comment and no prior executions, or QUEUED tasks (e.g. BUDGET_EXCEEDED retries) - web/app.js: prompt for optional rejection comment when rejecting a task, passing it through to the API instead of always sending an empty string Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 daysfix: permission denied and host key verification errors; add gemini ↵Peter Stone
elaboration fallback
13 daysfeat: fix task failures via sandbox improvements and display commits in Web UIPeter Stone
- Fix ephemeral sandbox deletion issue by passing $CLAUDOMATOR_PROJECT_DIR to agents and using it for subtask project_dir. - Implement sandbox autocommit in teardown to prevent task failures from uncommitted work. - Track git commits created during executions and persist them in the DB. - Display git commits and changestats badges in the Web UI execution history. - Add badge counts to Web UI tabs for Interrupted, Ready, and Running states. - Improve scripts/next-task to handle QUEUED tasks and configurable DB path.
2026-03-14feat: add agent selector to UI and support direct agent assignmentPeter Stone
- Added an agent selector (Auto, Claude, Gemini) to the Start Next Task button. - Updated the backend to pass query parameters as environment variables to scripts. - Modified the executor pool to skip classification when a specific agent is requested. - Added --agent flag to claudomator start command. - Updated tests to cover the new functionality.
2026-03-09scripts: pull latest from bare repo before building in deployPeter Stone
2026-03-08feat: stash uncommitted changes before build in deploy scriptPeter Stone
Add --dirty flag to skip stashing behavior. Stashing includes untracked files and uses a trap to ensure changes are popped back on exit.
2026-03-07feat: add create CLI command with --parent-id; deploy to /usr/local/binPeter Stone
claudomator create <name> -i <instructions> [flags] --parent-id attach as subtask of given task ID --working-dir working directory --model claude model --budget max USD --timeout task timeout --priority high/normal/low --start queue immediately after creating deploy script now also copies binary to /usr/local/bin/claudomator. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06recover: restore untracked work from recovery branch (no Gemini changes)Peter Stone
Recovered files with no Claude→Agent contamination: - docs/adr/002-task-state-machine.md - internal/api/logs.go/logs_test.go: task-level log streaming endpoint - internal/api/validate.go/validate_test.go: POST /api/tasks/validate - internal/api/server_test.go, storage/db_test.go: expanded test coverage - scripts/reset-failed-tasks, reset-running-tasks - web/app.js, index.html, style.css: frontend improvements - web/test/: active-tasks-tab, delete-button, filter-tabs, sort-tasks tests Manually applied from server.go diff (skipping Claude→Agent rename): - taskLogStore field + validateCmdPath field - DELETE /api/tasks/{id} route + handleDeleteTask - GET /api/tasks/{id}/logs/stream route - POST /api/tasks/{id}/resume route + handleResumeTimedOutTask - handleCancelTask: allow cancelling PENDING/QUEUED tasks directly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06fix: next-task correctly handles READY parent and COMPLETED sibling casesPeter Stone
READY state means a parent task whose subtasks should now run — select its first PENDING child, not a global fallback. COMPLETED state means continue the series via the next PENDING sibling. Only fall back to the priority+age queue when neither yields a task. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06fix: next-task falls back to priority queue when no pending siblings remainPeter Stone
When the most recently completed task had no remaining PENDING siblings (series fully done), the script returned empty and start-next-task reported "No task to start." Fix by falling through to the priority+age fallback whenever the sibling search yields nothing. Also add header comment documenting the selection logic, and suppress browser favicon 404s with <link rel="icon" href="data:,">. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06feat: blocked task state for agent questions via session resumePeter Stone
When an agent needs user input it writes a question to $CLAUDOMATOR_QUESTION_FILE and exits. The runner detects the file and returns BlockedError; the pool transitions the task to BLOCKED and stores the question JSON on the task record. The user answers via POST /api/tasks/{id}/answer. The server looks up the claude session_id from the most recent execution and submits a resume execution (claude --resume <session-id> "<answer>"), freeing the executor slot entirely while waiting. Changes: - task: add StateBlocked, transitions RUNNING→BLOCKED, BLOCKED→QUEUED - storage: add session_id to executions, question_json to tasks; add GetLatestExecution and UpdateTaskQuestion methods - executor: BlockedError type; ClaudeRunner pre-assigns --session-id, sets CLAUDOMATOR_QUESTION_FILE env var, detects question file on exit; buildArgs handles --resume mode; Pool.SubmitResume for resume path - api: handleAnswerQuestion rewritten to create resume execution - preamble: add question protocol instructions for agents - web: BLOCKED state badge (indigo), question text + option buttons or free-text input with Submit on the task card footer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05executor: persist log paths at execution create time, not just at endPeter Stone
Add LogPather interface; ClaudeRunner implements it via ExecLogDir(). Pool pre-populates stdout_path/stderr_path/artifact_dir on the execution record before CreateExecution, so paths are in the DB from the moment a task starts running. ClaudeRunner.Run() skips path assignment when already set by the pool. Also update scripts/debug-execution to derive paths from the known convention (<data-dir>/executions/<exec-id>/) as a fallback for historical records that predate this change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05allow running deploy as non-rootPeter Stone
2026-03-05scripts: add debug-execution and deployPeter Stone
debug-execution: inspect a failed execution by ID prefix from prod DB. deploy: build and restart the claudomator systemd service. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05scripts: make next-task machine-readable, simplify start-next-taskPeter Stone
next-task now outputs only the task ID (or nothing), removing prose prefixes that made downstream parsing fragile. start-next-task simplifies to a direct empty-check with no awk required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>