Commit graph

1038 commits

Author SHA1 Message Date
openhands
f4cf53613c fix: Gitea reviews API is fetched without pagination in multiple places (#191) 2026-03-18 20:05:29 +00:00
johba
fe0a2f6759 Merge pull request 'fix: fix: dev-agent merge failure on "not enough approvals" should escalate immediately (#171)' (#196) from fix/issue-171 into main 2026-03-18 20:59:45 +01:00
openhands
bb2af8db10 fix: address review feedback — set -e bug, sentinel path, fragile grep, stale comment (#171)
- Fix set -e bug: use `_merge_rc=0; do_merge ... || _merge_rc=$?` so non-zero
  returns don't kill the agent before _merge_rc is captured
- Fix sentinel path: skip sentinel break for APPROVE so do_merge() always runs,
  even when review-poll.sh injected the verdict first
- Fix fragile grep: match HTTP 405 alone instead of `grep -qi "not enough"` —
  any 405 from the merge endpoint is a structural block (approvals, branch
  protection), not a transient error
- Fix stale comment/status in PHASE:done handler: "orchestrator or Claude"
  instead of "agent"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:53:26 +00:00
openhands
374fe2b2b4 fix: fix: dev-agent merge failure on "not enough approvals" should escalate immediately (#171)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:45:13 +00:00
johba
210fae9cc4 Merge pull request 'fix: fix: review-pr.sh must dismiss own prior REQUEST_CHANGES before approving (#170)' (#190) from fix/issue-170 into main 2026-03-18 20:34:12 +01:00
openhands
79851f233f fix: fix: review-pr.sh must dismiss own prior REQUEST_CHANGES before approving (#170)
Before posting an APPROVED formal review, fetch all prior reviews by
the review bot on this PR and dismiss any with state REQUEST_CHANGES.
This unblocks merges when branch protection has dismiss_stale_approvals
and the bot has prior REQUEST_CHANGES reviews from earlier rounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 19:11:57 +00:00
johba
2f74eb3909 Merge pull request 'fix: feat: gardener formula — groom-backlog.toml with verify loop, remove timeouts (#183)' (#186) from fix/issue-183 into main 2026-03-18 19:51:09 +01:00
openhands
7456af65e9 fix: feat: gardener formula — groom-backlog.toml with verify loop, remove timeouts (#183)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:42:30 +00:00
johba
39cea52b0c Merge pull request 'fix: feat: dev-agent merges its own PRs via non-admin Codeberg account (#172)' (#184) from fix/issue-172 into main 2026-03-18 19:23:55 +01:00
openhands
775c290660 fix: update review-poll.sh approval injection to include merge commands
The APPROVE injection previously told the dev-agent to write PHASE:done
and let the orchestrator merge. Now the dev-agent merges directly, so the
injection includes the full merge + issue-close curl commands matching the
pattern already in the dev-agent.sh prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:10:30 +00:00
openhands
f73d5f471e fix: feat: dev-agent merges its own PRs via non-admin Codeberg account (#172)
- phase-handler.sh: remove do_merge(); on APPROVAL inject exact API
  commands for agent to merge+close directly; PHASE:done now only
  does local cleanup (tmux, worktree, labels) — merge already done
- dev-agent.sh: update PHASE_PROTOCOL_INSTRUCTIONS — Approved means
  merge via API, close issue, then write PHASE:done
- dev-poll.sh: remove try_merge_or_rebase(); for approved+CI-green
  orphaned PRs, spawn dev-agent (recovery mode) to merge instead
- .env.example: document new token roles (CODEBERG_TOKEN = bot for
  push/PR/merge; REVIEW_BOT_TOKEN = human account for approvals)
- AGENTS.md: update token descriptions to match new roles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:59:36 +00:00
johba
b38b2b13ae Merge pull request 'fix: fix: phase-handler.sh references LAST_PHASE_MTIME which is now internal to monitor_phase_loop (#181)' (#182) from fix/issue-181 into main 2026-03-18 18:44:02 +01:00
openhands
61c518116a fix: fix: phase-handler.sh references LAST_PHASE_MTIME which is now internal to monitor_phase_loop (#181)
Export LAST_PHASE_MTIME from monitor_phase_loop before invoking the callback
so that phase-handler.sh can compare phase file mtimes inside the awaiting_review
inner poll loop without hitting an unbound variable error under set -u.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:26:54 +00:00
johba
68fc89adf0 Merge pull request 'fix: feat: CI smoke test — syntax check + function resolution for all agent scripts (#177)' (#178) from fix/issue-177 into main 2026-03-18 18:19:03 +01:00
openhands
55b5628e24 feat: CI smoke test — syntax check + function resolution for all agent scripts (#177)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:11:02 +00:00
openhands
014965494b fix: implement monitor_phase_loop in agent-session.sh
Generic phase monitoring loop with callback for agent-specific handling.
Handles: idle timeout, session crash detection, terminal phases (done,
failed, needs_human, merged). Sets _MONITOR_LOOP_EXIT for the caller.
2026-03-18 16:40:51 +00:00
openhands
42fa8f48e0 fix: restore log, notify, notify_ctx functions to dev-agent.sh
Lost during #160 refactor. These are dev-agent specific (reference
$ISSUE, $THREAD_FILE, $LOGFILE) so they belong in the agent script,
not the shared library.
2026-03-18 16:37:55 +00:00
openhands
d83098f382 fix: pass SESSION_NAME to all agent-session.sh function calls
Library functions need explicit session name argument — they no longer
have closure over $SESSION_NAME from the parent script.

- agent_kill_session: add $SESSION_NAME to all 11 call sites
- agent_inject_into_session: add $SESSION_NAME to all call sites in
  phase-handler.sh and gardener-agent.sh
- agent_kill_session: guard against missing arg (defensive)
2026-03-18 16:24:58 +00:00
openhands
350acccd8b fix: add create_agent_session and inject_formula to agent-session.sh
Both dev-agent.sh and gardener-agent.sh call these functions but they
were never implemented during the #158 extraction. Adds:
- create_agent_session(session, workdir) — tmux + claude + wait for ready
- inject_formula(session, text) — alias for agent_inject_into_session
2026-03-18 16:21:05 +00:00
openhands
ae3e742f9f fix: rename function calls to match agent-session.sh exports (#176)
kill_tmux_session → agent_kill_session
inject_into_session → agent_inject_into_session
wait_for_claude_ready → agent_wait_for_claude_ready

Also restore status() function lost during #160 refactor.

Fixes dev-agent and gardener-agent crash on startup:
  line 149: status: command not found
  line 280: kill_tmux_session: command not found
2026-03-18 16:10:12 +00:00
johba
d27f6bcb99 fix: refactor: slim dev-agent.sh to use lib/agent-session.sh (#160) (#173)
Fixes #160

## Changes
Extracted phase callback functions (post_refusal_comment, do_merge, _on_phase_change) from dev/dev-agent.sh into new dev/phase-handler.sh. dev-agent.sh now sources both lib/agent-session.sh and dev/phase-handler.sh. Replaced inline dependency extraction with lib/parse-deps.sh. dev-agent.sh reduced from 1516 to 684 lines (55% reduction). AGENTS.md shellcheck command updated to include the new files.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/173
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-18 16:52:14 +01:00
johba
128a4a3e00 chore: refresh landing page — desire-led copy, drop agent grid (#161)
Rewrites disinto.ai landing page to speak to founders, not developers.

## Changes
- **Tagline:** "from vision to market fit" (was "your AI dev team")
- **Kill** the 6-agent technical grid
- **Add** 3 founder-focused value blocks: vision not code, quality gates, decisions not busywork
- **Add** proof-in-numbers section (219 commits / 50 issues / 0 human commits)
- **Add** design principles grid
- Agents mentioned once in footer

Already live at https://disinto.ai — this PR syncs the repo copy.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/161
Reviewed-by: review_bot <review_bot@noreply.codeberg.org>
2026-03-18 16:21:42 +01:00
johba
6d5cc4458f fix: feat: gardener-agent.sh — tmux + Claude interactive gardener using agent-session.sh (#159) (#163)
Fixes #159

## Changes
Add gardener-agent.sh (tmux+Claude) and lib/agent-session.sh (shared helpers). gardener-poll.sh slimmed to cron wrapper; grooming delegated to new agent; recipe engine for CI escalations unchanged.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/163
Reviewed-by: review_bot <review_bot@noreply.codeberg.org>
2026-03-18 16:21:07 +01:00
johba
4d88464edb Merge pull request 'fix: refactor: extract lib/agent-session.sh — reusable tmux + Claude agent runtime (#158)' (#165) from fix/issue-158 into main 2026-03-18 15:55:48 +01:00
openhands
cbd8c81da8 refactor: extract lib/agent-session.sh — reusable tmux + Claude agent runtime (#158)
Move generic agent infrastructure from dev/dev-agent.sh into lib/agent-session.sh:
- log, status, notify, notify_ctx, read_phase, wait_for_claude_ready,
  inject_into_session, kill_tmux_session extracted verbatim
- create_agent_session(session_name, workdir) — new: tmux session creation
- inject_formula(session_name, formula_text, context) — new: prompt injection
- monitor_phase_loop(phase_file, idle_timeout, callback_fn) — new: phase loop
  with session health check, crash recovery, and idle timeout detection

dev-agent.sh: sources the library, implements _on_phase_change() callback,
calls monitor_phase_loop(); idle-timeout and crash-recovery-failed cleanup
handled via _MONITOR_LOOP_EXIT signal variable. Behavior unchanged.
2026-03-18 14:36:36 +00:00
johba
0a18974e40 Merge pull request 'fix: Escalation write-once guard is not atomic (pre-existing) (#154)' (#157) from fix/issue-154 into main 2026-03-18 12:51:39 +01:00
openhands
d904192ab7 fix: Escalation write-once guard is not atomic (pre-existing) (#154)
- `ci_fix_check_and_increment` now accepts an optional `check_only` arg:
  - count < 3, check_only: returns `ok:N` without incrementing (deferred
    to launch time, preserving the WAITING_PRS protection)
  - count < 3, non-check_only: increments and returns `ok:N` (unchanged)
  - count == 3 (any mode): atomically bumps to 4 and returns
    `exhausted_first_time:3` — only one concurrent poller can win this
  - count > 3 (any mode): returns `exhausted:N` with no write

- `handle_ci_exhaustion` unified to a single code path for both
  check_only and non-check_only:
  - Writes escalation JSONL + matrix_send only when sentinel is
    `exhausted_first_time` — never on a bare integer comparison outside
    a lock
  - Removes the two separate `ci_fix_increment` bump-to-4 calls that
    were racy (the sentinel bump is now inside the flock in Python)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:44:30 +00:00
johba
9f44c512b6 Merge pull request 'fix: dev-agent CI retrigger sets LAST_PHASE_MTIME equal to touched phase file — main loop never re-enters awaiting_ci (#148)' (#156) from fix/issue-148 into main 2026-03-18 12:37:27 +01:00
openhands
e088f3e7ae fix: dev-agent CI retrigger sets LAST_PHASE_MTIME equal to touched phase file — main loop never re-enters awaiting_ci (#148)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:16:05 +00:00
johba
ba48d8a3e3 Merge pull request 'fix: gardener objective: zero tech-debt issues per run (#151)' (#155) from fix/issue-151 into main 2026-03-18 12:12:13 +01:00
openhands
ff3e790f51 fix: remove head -10 cap and update tech-debt problem label (#151)
Remove the head -10 cap from TECH_DEBT_ISSUES so Claude sees all
tech-debt issues, not just the first 10. Apply a head -50 guard on
the list passed in PROBLEMS to avoid oversized prompts while still
feeding far more than the old cap. Update the problem label to drop
"max 10 per run" text which contradicted the zero-tech-debt objective.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:03:29 +00:00
openhands
716bea9d7c fix: gardener objective: zero tech-debt issues per run (#151)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:45:31 +00:00
johba
b008f07861 Merge pull request 'fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125)' (#152) from fix/issue-125 into main 2026-03-18 11:41:51 +01:00
openhands
4dc64ea65b fix: restore deferred increment for backlog path to prevent counter leak
The previous commit introduced a counter leak in the backlog scan path:
handle_ci_exhaustion (without check_only) atomically incremented the CI
fix counter before the WAITING_PRS guard, so an exit 0 that never spawned
a dev-agent would silently consume one of the three allowed fix attempts.

Restore the READY_PR_FOR_INCREMENT / deferred-increment mechanism:
- Backlog scan calls handle_ci_exhaustion with "check_only" (read-only,
  no increment) to detect exhaustion without touching the counter.
- The counter is bumped atomically at LAUNCH time via handle_ci_exhaustion
  (without check_only), so the increment only happens when we are certain
  a dev-agent is being spawned. If a concurrent poller already exhausted
  the counter between scan and launch, the LAUNCH call returns 0 and we
  bail out cleanly without double-spawning.

The in-progress, stuck-PR, and try_merge_or_rebase paths are unaffected:
they call handle_ci_exhaustion without check_only, which continues to use
the atomic ci_fix_check_and_increment to prevent concurrent double-spawning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:34:41 +00:00
openhands
7bf13567fd fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125)
Add ci_fix_check_and_increment() that performs read + threshold-check +
conditional increment in a single flock-protected Python call, replacing
the prior three-step sequence (ci_fix_count / bash check / ci_fix_increment)
that allowed two concurrent poll invocations to both pass the threshold and
spawn duplicate dev-agents for the same PR.

handle_ci_exhaustion now calls ci_fix_check_and_increment atomically and
returns the new count in CI_FIX_ATTEMPTS; all separate ci_fix_increment
calls after handle_ci_exhaustion (including the deferred READY_PR_FOR_INCREMENT
mechanism) are removed. Log messages updated from CI_FIX_ATTEMPTS+1 to
CI_FIX_ATTEMPTS to reflect the post-increment count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:22:24 +00:00
johba
8d5ec5c625 Merge pull request 'fix: Add formula guard to backlog scan path (#127)' (#149) from fix/issue-127 into main 2026-03-18 11:09:55 +01:00
openhands
7d51e5e333 fix: Add formula guard to backlog scan path (#127) 2026-03-18 09:49:44 +00:00
johba
75223d3943 Merge pull request 'fix: CODEBERG_WEB not exported from lib/env.sh — other agents may hit the same gap (#129)' (#146) from fix/issue-129 into main 2026-03-18 10:47:24 +01:00
openhands
deeedd0cbf fix: CODEBERG_WEB not exported from lib/env.sh — other agents may hit the same gap (#129)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 09:40:20 +00:00
johba
b56e0d413e Merge pull request 'fix: review-poll.sh cleanup paths do not remove sentinel files (#138)' (#145) from fix/issue-138 into main 2026-03-18 10:36:49 +01:00
openhands
2241a9d630 fix: review-poll.sh cleanup paths do not remove sentinel files (#138) 2026-03-18 09:29:41 +00:00
johba
d71a1e2f8c Merge pull request 'fix: Coordinate review injection between review-poll.sh and dev-agent.sh to prevent double-injection (#90)' (#137) from fix/issue-90 into main 2026-03-18 10:13:54 +01:00
openhands
19a245fe5e fix: Coordinate review injection between review-poll.sh and dev-agent.sh to prevent double-injection (#90)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 09:01:50 +00:00
johba
a340e57789 Merge pull request 'fix: AGENTS.md and README.md not updated to document vault and planner agents (#95)' (#133) from fix/issue-95 into main 2026-03-18 09:57:26 +01:00
openhands
3e98bb2e9d fix: AGENTS.md and README.md not updated to document vault and planner agents (#95) 2026-03-18 08:50:08 +00:00
johba
f9b4207548 Merge pull request 'fix: ALL_COMMENTS fetch is capped at limit=50 — watermark search may miss reviews on high-comment PRs (#100)' (#132) from fix/issue-100 into main 2026-03-18 09:46:00 +01:00
openhands
d5b3f9e6e5 fix: codeberg_api_all propagates API errors instead of silently returning []
Remove || break from the codeberg_api call in the pagination loop.
With set -euo pipefail in all callers, a failed fetch now exits the
function non-zero — matching the original curl -sf behaviour where a
network or auth error aborted the script rather than returning empty
results and risking a duplicate review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 08:25:22 +00:00
openhands
9fa4846581 fix: ALL_COMMENTS fetch is capped at limit=50 — watermark search may miss reviews on high-comment PRs (#100)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 08:13:43 +00:00
johba
f4abe63b1b Merge pull request 'fix: needs_human notification sent every poll cycle pre-PR (#103)' (#131) from fix/issue-103 into main 2026-03-18 09:03:58 +01:00
openhands
9d2b92f0d5 fix: needs_human notification sent every poll cycle pre-PR (#103)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 07:35:13 +00:00