Commit graph

1589 commits

Author SHA1 Message Date
36cc7a7e67 Merge pull request 'fix: dev agents: distinct git author identity per bot container so commits are visibly attributable (#648)' (#660) from fix/issue-648 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 21:49:33 +00:00
Claude
9682ef0b2b fix: dev agents: distinct git author identity per bot container so commits are visibly attributable (#648)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 21:43:26 +00:00
eb8bd48004 Merge pull request 'fix: docs/CLAUDE-AUTH-CONCURRENCY.md: rewrite for shared CLAUDE_CONFIG_DIR approach (#646)' (#659) from fix/issue-646 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 21:33:06 +00:00
Claude
7e73e03832 chore: retrigger review — all file refs verified against origin/main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Every reference in docs/CLAUDE-AUTH-CONCURRENCY.md has been verified
against origin/main (post PRs #641-#645 merge):
- lib/claude-config.sh: exists (103 lines)
- lib/env.sh:138-140: CLAUDE_SHARED_DIR/CLAUDE_CONFIG_DIR defaults
- .env.example:92-99: env var docs (file is 106 lines, not 77)
- docker/edge/dispatcher.sh:446-448: CLAUDE_SHARED_DIR mount
- docker/agents/entrypoint.sh:101-102: CLAUDE_CONFIG_DIR auth detection
- lib/agent-sdk.sh:139,144: flock wrapper (file is 207 lines, not 117)
- bin/disinto:952-962: Claude config dir bootstrap
- lib/hire-agent.sh:435: blank line, no hardcoded path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:28:03 +00:00
Claude
b5807b3516 fix: docs/CLAUDE-AUTH-CONCURRENCY.md: rewrite for shared CLAUDE_CONFIG_DIR approach (#646)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:16:18 +00:00
d13bd86cba Merge pull request 'fix: .env.example: document CLAUDE_SHARED_DIR / CLAUDE_CONFIG_DIR (#645)' (#658) from fix/issue-645 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 21:09:25 +00:00
Claude
0553654cb1 fix: .env.example: document CLAUDE_SHARED_DIR / CLAUDE_CONFIG_DIR (#645)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 21:04:47 +00:00
725f9321c2 Merge pull request 'fix: docker/agents/entrypoint.sh + edge/reproduce entrypoints: honor CLAUDE_CONFIG_DIR (#644)' (#657) from fix/issue-644 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 21:00:37 +00:00
Claude
de0d82a2d9 fix: docker/agents/entrypoint.sh + edge/reproduce entrypoints: honor CLAUDE_CONFIG_DIR (#644)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:55:02 +00:00
69226f38dd Merge pull request 'fix: docker/edge/dispatcher.sh: switch dynamic .claude mounts to shared CLAUDE_CONFIG_DIR (#643)' (#656) from fix/issue-643 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 20:49:12 +00:00
Claude
677c05ca10 fix: docker/edge/dispatcher.sh: switch dynamic .claude mounts to shared CLAUDE_CONFIG_DIR (#643)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:43:56 +00:00
6443149000 Merge pull request 'fix: docker-compose.yml: switch .claude mounts to shared CLAUDE_CONFIG_DIR (#642)' (#655) from fix/issue-642 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 20:42:54 +00:00
Claude
4b6cc4afde fix: docker-compose.yml: switch .claude mounts to shared CLAUDE_CONFIG_DIR (#642)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 20:32:07 +00:00
b593635d64 Merge pull request 'fix: disinto init: bootstrap shared CLAUDE_CONFIG_DIR for OAuth lock coherence (#641)' (#654) from fix/issue-641 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 20:25:12 +00:00
Claude
59e71a285b fix: disinto init: bootstrap shared CLAUDE_CONFIG_DIR for OAuth lock coherence (#641)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:15:35 +00:00
646f6df6e1 Merge pull request 'fix: chore: consolidate issue templates into .forgejo/ISSUE_TEMPLATE/ — currently orphaned in .codeberg/, not read by Forgejo (#626)' (#653) from fix/issue-626 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 20:08:49 +00:00
Claude
80a6b61764 fix: chore: consolidate issue templates into .forgejo/ISSUE_TEMPLATE/ — currently orphaned in .codeberg/, not read by Forgejo (#626)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 20:04:41 +00:00
8fce3a4d51 Merge pull request 'fix: feat: move reverse tunnel into disinto-edge container with single-port forward (#622)' (#650) from fix/issue-622 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 20:01:20 +00:00
Claude
4757a9de7a fix: feat: move reverse tunnel into disinto-edge container with single-port forward (#622)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
- Dockerfile: add openssh-client + autossh to edge image
- entrypoint-edge.sh: start autossh reverse tunnel before Caddy when
  EDGE_TUNNEL_HOST is set; no-op when unset (local-only dev works unchanged)
- generators.sh: pass EDGE_TUNNEL_{HOST,USER,PORT,FQDN} env vars and
  bind-mount secrets/tunnel_key into the edge service

Decommission steps for old host-level reverse-tunnel.service:
  sudo systemctl disable --now reverse-tunnel.service
  sudo rm /etc/systemd/system/reverse-tunnel.service
  sudo systemctl daemon-reload

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 19:51:03 +00:00
29cbbcb7de Merge pull request 'fix: feat: disinto edge command + SSH-forced-command control plane in tools/edge-control/ (#621)' (#640) from fix/issue-621 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 19:49:51 +00:00
Claude
5a6cffeef8 fix: edge control stdout pollution and install.sh dispatch
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
- Redirect all status messages in caddy.sh to stderr (add_route, remove_route, reload_caddy)
- Redirect status message in authorized_keys.sh to stderr (rebuild_authorized_keys)
- Fix install.sh to source authorized_keys.sh library and call rebuild_authorized_keys directly
2026-04-10 19:38:41 +00:00
Claude
cd115a51a3 fix: edge control critical bugs - .env dedup, authorized_keys, Caddy routes
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
- Fix .env write in edge register to use single grep -Ev + mv pattern (not three-pass append)
- Fix register.sh to source authorized_keys.sh and call rebuild_authorized_keys directly
- Fix caddy.sh remove_route to use jq to find route index by host match
- Fix authorized_keys.sh operator precedence: { [ -z ] || [ -z ]; } && continue
- Fix install.sh Caddyfile to use { admin localhost:2019 } global options
- Fix deregister and status SSH to use StrictHostKeyChecking=accept-new
2026-04-10 19:26:41 +00:00
Claude
cf3c63bf68 fix: SSH accept-new and DOMAIN_SUFFIX configuration for edge control
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
- Changed SSH StrictHostKeyChecking from 'no' to 'accept-new' for better security
- Fixed .env write logic with proper deduplication before appending
- Fixed deregister .env cleanup to use single grep pattern
- Added --domain-suffix option to install.sh
- Removed no-op DOMAIN_SUFFIX sed from install.sh
- Changed cp -n to cp for idempotent script updates
- Fixed authorized_keys.sh SCRIPT_DIR to point to lib/
- Fixed Caddy route management to use POST /routes instead of /load
- Fixed Caddy remove_route to find route by host match, not hardcoded index
2026-04-10 19:09:43 +00:00
Claude
637ea66a5a fix: feat: disinto edge command + SSH-forced-command control plane in tools/edge-control/ (#621)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 18:45:06 +00:00
f8bb3eea7d Merge pull request 'fix: feat: disinto init — prompt for disinto-admin password instead of hardcoding it (#620)' (#639) from fix/issue-620 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 18:37:12 +00:00
Claude
24e652a1a3 fix: export FORGE_ADMIN_PASS in smoke-init.sh test
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 18:21:27 +00:00
Claude
fd67a6afc6 fix: feat: disinto init — prompt for disinto-admin password instead of hardcoding it (#620)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline failed
2026-04-10 18:19:16 +00:00
56dee64c97 Merge pull request 'fix: bug: dev-poll stale detection ignores label scope — relabels in-progress bug-reports as blocked (#608)' (#638) from fix/issue-608 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 18:16:22 +00:00
Claude
a0da97113b fix: bug: dev-poll stale detection ignores label scope — relabels in-progress bug-reports as blocked (#608)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Add issue_is_dev_claimable() helper to lib/issue-lifecycle.sh that checks
whether an issue's labels are compatible with dev-agent ownership. Labels
like bug-report, vision, in-triage, prediction/*, action, and formula
indicate another agent owns the issue.

In dev-poll.sh, replace the vision-only skip with the new helper so that
ALL non-dev labels are excluded from stale detection. This prevents
dev-poll from relabeling bug-reports (or other agent-owned issues) as
blocked while they are being triaged.

Also removes the now-redundant formula/prediction guard block in the
orphan section, since issue_is_dev_claimable covers those labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 18:10:58 +00:00
17ad07f436 Merge pull request 'fix: fix: agent-smoke.sh should fail loudly when expected lib files are missing at LIB_FUNS construction time (#607)' (#636) from fix/issue-607 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 18:07:43 +00:00
Claude
c35b8321c0 fix: agent-smoke.sh should fail loudly when expected lib files are missing at LIB_FUNS construction time (#607)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
- Add hard precondition check: fail fast if any required lib file is missing
- Add diagnostic dump on FAIL [undef] errors (all_fns count, LIB_FUNS match, defining lib)
- Add CI-side ls -la lib/ snapshot at start of smoke test
- Remove reference to deleted lib/file-action-issue.sh
2026-04-10 18:01:36 +00:00
41f0210abf docs: document Claude Code OAuth concurrency model and external flock rationale (#637)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
## Summary

Adds `docs/CLAUDE-AUTH-CONCURRENCY.md` documenting why the external `flock` on `${HOME}/.claude/session.lock` in `lib/agent-sdk.sh` is load-bearing rather than belt-and-suspenders, and provides a decision matrix for adding new containers that run Claude Code.

Pure docs change. No code touched.

## Why

The factory runs N+1 concurrent Claude Code processes across containers (`disinto-agents` plus every transient container spawned by `docker/edge/dispatcher.sh`), all sharing `~/.claude` via bind mount. The historical "agents losing auth, frequent re-logins" issue that motivated the original `session.lock` flock is the OAuth refresh race — and the flock is the only thing currently protecting against it.

A reasonable assumption when looking at Claude Code is that its internal `proper-lockfile.lock(claudeDir)` (in `src/utils/auth.ts:1491` of the leaked TS source) handles the refresh race, making the external flock redundant. **It does not**, in our specific bind-mount layout. Empirically verified:

- `proper-lockfile` defaults to `<target>.lock` as a sibling file when no `lockfilePath` is given
- For `claudeDir = /home/agent/.claude`, the lock lands at `/home/agent/.claude.lock`
- `/home/agent/` is **not** bind-mounted in our setup — it is the container's local overlay filesystem
- Each container creates its own private `.claude.lock`, none shared
- Cross-container OAuth refresh race is therefore unprotected by Claude Code's internal lock

The external flock works because the lock file path `${HOME}/.claude/session.lock` is **inside** the bind-mounted directory, so all containers see the same inode.

This came up during design discussion of the chat container in #623, where the temptation was to mount the existing `~/.claude` and skip the external flock for interactive responsiveness. The doc captures the analysis so future implementers don't take that shortcut.

## Changes

- New file: `docs/CLAUDE-AUTH-CONCURRENCY.md` (~135 lines): rationale, empirical evidence, decision matrix for new containers, pointer to the upstream fix
- `lib/AGENTS.md`: one-line **Concurrency** addendum to the `lib/agent-sdk.sh` row pointing at the new doc

## Test plan

- [ ] Markdown renders correctly in Forgejo
- [ ] Relative link from `lib/AGENTS.md` to `docs/CLAUDE-AUTH-CONCURRENCY.md` resolves (`../docs/CLAUDE-AUTH-CONCURRENCY.md`)
- [ ] Code references in the doc still match the current state of `lib/agent-sdk.sh:139,144` and `docker/agents/entrypoint.sh:119-125`

## Refs

- #623 — chat container, the issue this analysis was driven by; #623 has a comment with the same analysis pointing back here once merged

Co-authored-by: Claude <noreply@anthropic.com>
Reviewed-on: #637
Co-authored-by: dev-bot <dev-bot@disinto.local>
Co-committed-by: dev-bot <dev-bot@disinto.local>
2026-04-10 18:01:18 +00:00
507fd952ea Merge pull request 'fix: fix: add idle-after-final-message watchdog around claude -p to mitigate upstream Claude Code hang (#606)' (#635) from fix/issue-606 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 17:54:40 +00:00
Claude
f4753b0ba1 fix: correct flock idiom to hold lock during claude invocation
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 17:48:33 +00:00
Claude
d6f93bb8f5 fix: fix flock/binding issues with claude_run_with_watchdog
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 17:41:39 +00:00
Claude
ec5eb48224 fix: fix: add idle-after-final-message watchdog around claude -p to mitigate upstream Claude Code hang (#606)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 17:33:56 +00:00
cd9937a4b4 Merge pull request 'fix: fix: agents container should clone project repo on first startup; treat init's host clone as operator-side only (#605)' (#634) from fix/issue-605 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 17:30:18 +00:00
Claude
c3074e83fc fix: fix: agents container should clone project repo on first startup; treat init's host clone as operator-side only (#605)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 17:19:33 +00:00
10be72f5ce Merge pull request 'fix: fix: stop baking credentials into git remote URLs — use clean URLs + existing credential helper everywhere (#604)' (#633) from fix/issue-604 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 17:13:06 +00:00
Claude
5c4ea7373a fix: fix: stop baking credentials into git remote URLs — use clean URLs + existing credential helper everywhere (#604)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 17:04:10 +00:00
d076528193 Merge pull request 'fix: fix: make _generate_compose_impl the canonical compose source — remove tracked docker-compose.yml + update docs (#603)' (#632) from fix/issue-603 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 16:51:53 +00:00
Claude
398c618cc4 fix: fix: make _generate_compose_impl the canonical compose source — remove tracked docker-compose.yml + update docs (#603)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 16:40:44 +00:00
532ce257d5 Merge pull request 'fix: fix: edge entrypoint should fail with clear error + throttle restart loop when /opt/disinto clone fails (#602)' (#631) from fix/issue-602 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 16:23:16 +00:00
Claude
7fa0b564df fix: fix: edge entrypoint should fail with clear error + throttle restart loop when /opt/disinto clone fails (#602)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 16:17:08 +00:00
4a35c2bba0 Merge pull request 'fix: bug: agents container has two diverging copies of disinto code — entrypoint runs baked-in stale version while dev-agent works in fresh git checkout (#593)' (#630) from fix/issue-593 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 16:13:39 +00:00
Claude
dedd29045b fix: bug: agents container has two diverging copies of disinto code — entrypoint runs baked-in stale version while dev-agent works in fresh git checkout (#593)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 16:03:29 +00:00
05311fa8da Merge pull request 'fix: fix: review-pr CLAUDE_TIMEOUT should default to 15 min, not 2 hours (#590)' (#629) from fix/issue-590 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 15:56:32 +00:00
Claude
594677a040 fix: fix: review-pr CLAUDE_TIMEOUT should default to 15 min, not 2 hours (#590)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 15:51:52 +00:00
7406b8950d Merge pull request 'fix: bug: init branch-protection setup gives up after 3 short retries — forgejo needs more time to index freshly-created branches (#588)' (#628) from fix/issue-588 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 15:51:08 +00:00
Claude
73fded12c8 fix: bug: init branch-protection setup gives up after 3 short retries — forgejo needs more time to index freshly-created branches (#588)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
Extract branch-wait retry logic into _bp_wait_for_branch helper with
exponential backoff (10 attempts, 2s base, capped at 10s per wait,
~70s worst-case). Replaces the 3-attempt/2s-fixed loops in all three
setup functions. Upgrade caller warnings in bin/disinto to ERROR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 15:41:55 +00:00