<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claudomator.git/internal/cli/serve.go, branch story/task-project-fk</title>
<subtitle>claudomator — task automation server
</subtitle>
<id>https://git.terst.org/claudomator.git/atom?h=story%2Ftask-project-fk</id>
<link rel='self' href='https://git.terst.org/claudomator.git/atom?h=story%2Ftask-project-fk'/>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/'/>
<updated>2026-03-26T09:14:14+00:00</updated>
<entry>
<title>feat: graceful shutdown — drain workers before exit (default 3m timeout)</title>
<updated>2026-03-26T09:14:14+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-26T09:09:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=3f9843b34d7ae9df2dd9c69427ecab45744b97e9'/>
<id>urn:sha1:3f9843b34d7ae9df2dd9c69427ecab45744b97e9</id>
<content type='text'>
- Add workerWg to Pool; Shutdown() closes workCh and waits for all
  in-flight execute/executeResume goroutines to finish
- Signal handler now shuts down HTTP first, then drains the pool
- ShutdownTimeout config field (toml: shutdown_timeout); default 3m
- Tests: WaitsForWorkers and TimesOut

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: Phase 4 — story-aware execution, branch clone, story completion check, deployment status</title>
<updated>2026-03-23T07:12:08+00:00</updated>
<author>
<name>Claudomator Agent</name>
<email>agent@claudomator.dev</email>
</author>
<published>2026-03-23T07:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=b2e77009c55ba0f07bb9ff904d9f2f6cc9ff0ee2'/>
<id>urn:sha1:b2e77009c55ba0f07bb9ff904d9f2f6cc9ff0ee2</id>
<content type='text'>
- ContainerRunner: add Store field; clone with --reference when story has a
  local project path; checkout story branch after clone; push to story branch
  instead of HEAD
- executor.Store interface: add GetStory, ListTasksByStory, UpdateStoryStatus
- Pool.handleRunResult: trigger checkStoryCompletion when a story task succeeds
- Pool.checkStoryCompletion: transitions story to SHIPPABLE when all tasks done
- serve.go: wire Store into each ContainerRunner
- stories.go: update createStoryBranch to fetch+checkout from origin/master base;
  add GET /api/stories/{id}/deployment-status endpoint
- server.go: register deployment-status route
- Tests: TestPool_CheckStoryCompletion_AllComplete/PartialComplete,
  TestHandleStoryDeploymentStatus

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: populate RepositoryURL from project registry in executor (ADR-007)</title>
<updated>2026-03-23T06:50:10+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-23T06:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=bc62c3545bbcf3f9ccc508cdc43ce9ffdb5dfad0'/>
<id>urn:sha1:bc62c3545bbcf3f9ccc508cdc43ce9ffdb5dfad0</id>
<content type='text'>
- Add GetProject to Store interface used by executor
- Resolve RepositoryURL from project registry when task.RepositoryURL is empty
- Call SeedProjects at server startup so the project registry is populated
- Add GetProject stub to minimalMockStore in executor tests

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: executor reliability — per-agent limit, drain gate, pre-flight creds, auth recovery</title>
<updated>2026-03-21T23:18:50+00:00</updated>
<author>
<name>Claudomator Agent</name>
<email>agent@claudomator.local</email>
</author>
<published>2026-03-21T23:18:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=8dca9bbb0baee59ffe0d3127180ef0958dda8b91'/>
<id>urn:sha1:8dca9bbb0baee59ffe0d3127180ef0958dda8b91</id>
<content type='text'>
- maxPerAgent=1: only 1 in-flight execution per agent type at a time; excess tasks are requeued after 30s
- Drain gate: after 2 consecutive failures the agent is drained and a question is set on the task; reset on first success; POST /api/pool/agents/{agent}/undrain to acknowledge
- Pre-flight credential check: verify .credentials.json and .claude.json exist in agentHome before spinning up a container
- Auth error auto-recovery: detect auth errors (Not logged in, OAuth token has expired, etc.) and retry once after running sync-credentials and re-copying fresh credentials
- Extracted runContainer() helper from ContainerRunner.Run() to support the retry flow
- Wire CredentialSyncCmd in serve.go for all three ContainerRunner instances
- Tests: TestPool_MaxPerAgent_*, TestPool_ConsecutiveFailures_*, TestPool_Undrain_*, TestContainerRunner_Missing{Credentials,Settings}_FailsFast, TestIsAuthError_*, TestContainerRunner_AuthError_SyncsAndRetries

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix: use configured claude_config_dir for container credentials</title>
<updated>2026-03-21T20:51:35+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-21T20:51:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=30bb8b45ea515c40da4d46ee12a20f2c7ae75e62'/>
<id>urn:sha1:30bb8b45ea515c40da4d46ee12a20f2c7ae75e62</id>
<content type='text'>
The server runs as www-data whose HOME is /var/www — deriving
credentials from $HOME/.claude always produced an empty path.
Now reads from ClaudeConfigDir (default: /workspace/claudomator/credentials/claude),
which sync-credentials keeps populated with fresh OAuth tokens.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: containerized execution with agent tooling and deployment fixes</title>
<updated>2026-03-18T23:56:20+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-18T23:56:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=7df4f06ae0e3ae80bd967bf53cbec36e58b4a3bd'/>
<id>urn:sha1:7df4f06ae0e3ae80bd967bf53cbec36e58b4a3bd</id>
<content type='text'>
- 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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix: address final container execution issues and cleanup review docs</title>
<updated>2026-03-18T07:55:27+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-18T07:54:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=a4795d68fc5381f1ff48d043fe7554355e5899fb'/>
<id>urn:sha1:a4795d68fc5381f1ff48d043fe7554355e5899fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: comprehensive addressing of container execution review feedback</title>
<updated>2026-03-18T07:54:48+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-18T00:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=5814e7d6bdec659bb8ca10cc18447a821c59ad4c'/>
<id>urn:sha1:5814e7d6bdec659bb8ca10cc18447a821c59ad4c</id>
<content type='text'>
- Fix Critical Bug 1: Only remove workspace on success, preserve on failure/BLOCKED.
- Fix Critical Bug 2: Use correct Claude flag (--resume) and pass instructions via file.
- Fix Critical Bug 3: Actually mount and use the instructions file in the container.
- Address Design Issue 4: Implement Resume/BLOCKED detection and host-side workspace re-use.
- Address Design Issue 5: Consolidate RepositoryURL to Task level and fix API fallback.
- Address Design Issue 6: Make agent images configurable per runner type via CLI flags.
- Address Design Issue 7: Secure API keys via .claudomator-env file and --env-file flag.
- Address Code Quality 8: Add unit tests for ContainerRunner arg construction.
- Address Code Quality 9: Fix indentation regression in app.js.
- Address Code Quality 10: Clean up orphaned Claude/Gemini runner files and move helpers.
- Fix tests: Update server_test.go and executor_test.go to work with new model.
</content>
</entry>
<entry>
<title>feat: implement containerized repository-based execution model</title>
<updated>2026-03-18T07:54:48+00:00</updated>
<author>
<name>Peter Stone</name>
<email>thepeterstone@gmail.com</email>
</author>
<published>2026-03-18T00:17:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=0fb4e3e81c20b2e2b58040772b747ec1dd9e09e7'/>
<id>urn:sha1:0fb4e3e81c20b2e2b58040772b747ec1dd9e09e7</id>
<content type='text'>
This commit implements the architectural shift from local directory-based
sandboxing to containerized execution using canonical repository URLs.

Key changes:
- Data Model: Added RepositoryURL and ContainerImage to task/agent configs.
- Storage: Updated SQLite schema and queries to handle new fields.
- Executor: Implemented ContainerRunner using Docker/Podman for isolation.
- API/UI: Overhauled task creation to use Repository URLs and Image selection.
- Webhook: Updated GitHub webhook to derive Repository URLs automatically.
- Docs: Updated ADR-005 with risk feedback and added ADR-006 to document the
  new containerized model.
- Defaults: Updated serve command to use ContainerRunner for all agents.

This fixes systemic task failures caused by build dependency and permission
issues on the host system.
</content>
</entry>
<entry>
<title>fix: validate VAPID public key on load, regenerate if swapped</title>
<updated>2026-03-17T08:04:04+00:00</updated>
<author>
<name>Claudomator Agent</name>
<email>agent@claudomator</email>
</author>
<published>2026-03-17T08:04:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=b9039dbf194f66738766cb4296ba6d141d6d433e'/>
<id>urn:sha1:b9039dbf194f66738766cb4296ba6d141d6d433e</id>
<content type='text'>
The DB may contain keys generated before the swap fix, with the private
key stored as the public key. Add ValidateVAPIDPublicKey() and use it in
serve.go to detect and regenerate invalid stored keys on startup.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
