Commit graph

1564 commits

Author SHA1 Message Date
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
506a00151b Merge pull request 'fix: bug: migrate_ops_repo emits fatal: not in a git directory mid-migration, silently skipping commit/push (#587)' (#627) from fix/issue-587 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 15:36:19 +00:00
Claude
55156fbac1 fix: bug: migrate_ops_repo emits fatal: not in a git directory mid-migration, silently skipping commit/push (#587)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 15:31:52 +00:00
8ce9cb9803 Merge pull request 'fix: bug: migrate_ops_repo seeds canonical structure in host path but agents container uses a Docker named volume — migration is orphaned (#586)' (#625) from fix/issue-586 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 15:17:42 +00:00
Claude
3405879d8b fix: mock-forgejo path parsing bug + non-fatal cron in smoke-init (#586)
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 off-by-one in mock admin/users/{username}/repos path extraction
  (parts[4] was 'users', not the username — should be parts[5])
- Change _install_cron_impl to return 1 instead of exit 1 when crontab
  is missing, so cron failure doesn't abort entire init

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 15:08:43 +00:00
Claude
d190296af1 fix: consolidate TOML parsing in bootstrap_ops_repos into single python3 call (#586)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline failed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:55:33 +00:00
Claude
57a177a37d fix: bug: migrate_ops_repo seeds canonical structure in host path but agents container uses a Docker named volume — migration is orphaned (#586)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline failed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:52:11 +00:00
Claude
d60a3da1b1 fix: bug: migrate_ops_repo seeds canonical structure in host path but agents container uses a Docker named volume — migration is orphaned (#586)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline failed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:48:47 +00:00
0612bb25d0 Merge pull request 'fix: bug: setup_ops_repo tries POST /api/v1/orgs/disinto-admin/repos but disinto-admin is a user, not an org (#585)' (#624) from fix/issue-585 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 14:40:47 +00:00
Claude
6dc42c3d1a fix: bug: via_msg unbound variable under set -euo pipefail (#585)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 14:37:54 +00:00
Claude
c7e43e091a fix: bug: setup_ops_repo tries POST /api/v1/orgs/disinto-admin/repos but disinto-admin is a user, not an org (#585)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 14:31:18 +00:00
316f9fd64b Merge pull request 'fix: bug: bin/disinto init rotates all bot tokens and passwords on every run, invalidating existing cloned repos with embedded credentials (#584)' (#618) from fix/issue-584 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 14:30:18 +00:00
Claude
cecfb3374d fix: bug: bin/disinto init rotates all bot tokens and passwords on every run, invalidating existing cloned repos with embedded credentials (#584)
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 14:18:27 +00:00
6b858c9c43 Merge pull request 'fix: bug: setup_forge's admin_token is a local variable, not exported — setup_ops_repo falls back to dev-bot token and fails with 403 (#583)' (#617) from fix/issue-583 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 14:14:35 +00:00
Claude
e58caa5dfd fix: bug: setup_forge's admin_token is a local variable, not exported — setup_ops_repo falls back to dev-bot token and fails with 403 (#583)
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 14:07:49 +00:00
6305597156 Merge pull request 'fix: bug: setup_forge has ~6 other anonymous curl checks for user/repo existence, all fail with 403 on locked-down forgejos (#582)' (#616) from fix/issue-582 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 14:04:55 +00:00
Claude
817d691e4d fix: bug: setup_forge has ~6 other anonymous curl checks for user/repo existence, all fail with 403 on locked-down forgejos (#582)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 13:58:48 +00:00
31639b95f4 Merge pull request 'fix: bug: setup_forge reachability check uses unauthenticated curl against /api/v1/version, fails on REQUIRE_SIGNIN_VIEW=true forgejos (#581)' (#615) from fix/issue-581 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 13:41:58 +00:00
Claude
c753bebb14 fix: bug: setup_forge reachability check uses unauthenticated curl against /api/v1/version, fails on REQUIRE_SIGNIN_VIEW=true forgejos (#581)
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 13:36:02 +00:00
7c8f734d6c Merge pull request 'fix: bug: set -o pipefail + git ls-remote failure silently kills dev-agent with no log line (#577)' (#614) from fix/issue-577 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 13:35:10 +00:00
Claude
0b7a41c3a1 fix: bug: set -o pipefail + git ls-remote failure silently kills dev-agent with no log line (#577)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 13:33:02 +00:00
56a4700e16 Merge pull request 'fix: bug: agents entrypoint creates log dir as root, then gosu agent can't mkdir subdirs (#576)' (#613) from fix/issue-576 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 13:11:44 +00:00
Claude
af74eedad9 fix: bug: agents entrypoint creates log dir as root, then gosu agent can't mkdir subdirs (#576)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-10 13:05:30 +00:00
b591e38153 Merge pull request 'fix: bug: tracked docker-compose.yml missing DISINTO_CONTAINER=1 on agents / agents-llama (#575)' (#612) from fix/issue-575 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 13:00:03 +00:00
Claude
5997667cb5 fix: bug: tracked docker-compose.yml missing DISINTO_CONTAINER=1 on agents / agents-llama (#575)
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 12:54:45 +00:00
dbf1340027 Merge pull request 'fix: bug: dev-agent.sh line 272 — grep -c ... || echo 0 produces "0\n0" and breaks arithmetic (#574)' (#611) from fix/issue-574 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
2026-04-10 12:49:44 +00:00