Commit Graph

32 Commits

Author SHA1 Message Date
Rebase Agent e27fcf4fe0 Use prompt_async (not /message) for idle-worker continue to avoid blocking 2026-05-13 23:39:53 +00:00
Rebase Agent 65661ae20d Fix cleanup_orphan_tmp_dirs to clean up when zero active sessions 2026-05-13 22:50:22 +00:00
Rebase Agent 33e61756ac Increase list-script timeout from 5 minutes to 20 minutes 2026-05-13 22:38:57 +00:00
Rebase Agent 75ca24f709 Share list-script cache across pools within an iteration 2026-05-13 22:29:19 +00:00
Rebase Agent a18e061dbd Fix worker_num corruption when JSON items contain pipe chars in body text 2026-05-13 22:08:59 +00:00
Rebase Agent 104bc2cacc Capture and display stderr from failing list scripts for debugging 2026-05-13 21:42:57 +00:00
Rebase Agent 60137b5879 Suppress stderr warnings for session script progress output (non-errors) 2026-05-13 20:12:12 +00:00
Rebase Agent 93f594e8ff Fix opencode-builder.sh: jq iteration, cache dir isolation, and work_num validation 2026-05-13 20:07:02 +00:00
Rebase Agent 70ed8ee34f build: fixed bug in cache_pids 2026-05-13 15:46:15 -04:00
Rebase Agent 42a7b3ace2 build: addeding debugging to script 2026-05-13 14:21:05 -04:00
Rebase Agent 0716cd81f1 build: addeding debugging to script 2026-05-13 13:43:17 -04:00
Rebase Agent 83ea35cea3 build: force credentials from env, block non-numeric pr ids 2026-05-13 13:32:56 -04:00
Rebase Agent d8d1273dfa build: fixed bad filenames in script 2026-05-13 13:02:04 -04:00
Rebase Agent 0df2921c90 build: fixed script syntax error 2026-05-13 11:31:43 -04:00
freemo 58df97707b build: better debugging output from script 2026-05-12 21:56:33 -04:00
freemo d4f0660aa2 fix: parallel pre-fetch, timeouts, newline-safe prompts, verbose logging
opencode-builder.sh: major reliability and correctness fixes:

- Parallel pre-fetch per pool: ALL list_prs_*.ts scripts for a pool now
  launch in parallel (background jobs), results cached to temp files. Each
  pool iteration fetches all work-group data in ONE parallel batch (~90s)
  instead of 11 sequential ~90s calls (~990s). The bottleneck is Forgejo
  API speed, not sequential script execution.

- Timeouts everywhere: SCRIPT_TIMEOUT_SEC raised 60s→300s (Forgejo is slow).
  find_sessions_by_prefix and other session_* scripts get 30s timeout via
  the timeout(1) utility. fetch_list_script catches timeout exit codes
  (124, 137, 139, 143) and returns [] gracefully.

- Prompt builders fixed: build_impl_prompt, build_merge_prompt,
  build_review_prompt now collapse newlines in title/body via tr+sed so
  the prompt file stays valid as plain text. Full item JSON embedded as
  compact single-line (jq -c .) at end of prompt.

- Verbose step logging: [step2], [pool:NAME] prefixes throughout main
  loop show exactly which stage is running and where any hang occurs.

- BUILDER_DEBUG=1 env var enables bash -x tracing for deep debugging.

Note: find_sessions_by_prefix --status busy returns empty (OpenCode
/session/status only reports the supervisor session). busy_count=0 when
all session status fields are empty, making all slots available. The
total session count is logged alongside active count for visibility.
2026-05-12 23:18:16 +00:00
freemo 3d12bdec45 fix: rewrite opencode-builder.sh cleanly — parallel workers, correct status, better output 2026-05-12 20:40:09 +00:00
freemo 3d2f9ae043 fix: count workers by last_active timestamp, not status API
The OpenCode /session/status endpoint reports all async workers as
"idle" even while they are actively processing — making the previous
--status busy filter always return empty and workers count as 0.

Fixes across the board:

- get_active_worker_tags() and count_active_workers(): new functions
  that filter by last_active >= (now - 2 min) instead of status field.

- Pool launcher: use count_active_workers() for the busy count, and
  extract exclude_numbers from active sessions' tags.

- Health cycle idle check: was using --status idle (returns all sessions
  since everything is "idle"). Now uses --status all + last_active
  threshold to find genuinely idle workers.

- Doom loop check: was using --status busy (returns nothing). Now uses
  --status all + last_active < (now - 30 min) to find abandoned sessions.

- fetch_list_script: guard against corrupted JSON when stderr messages
  from the script contaminate stdout — only accept output starting with
  "[" as valid JSON.

- Worker launch: add --restart so stale sessions are always replaced
  with fresh workers.

- Add IDLE_THRESHOLD_MS (3 min) constant for the health cycle.
2026-05-12 19:27:56 +00:00
freemo 978200e48a build: parallel worker launch in opencode-builder.sh
Previously workers were launched sequentially (2-3s each), causing
30+ second delays per pool in iteration #1 and making the health
check cycle stall. Now:

- Collect all work items for a pool into an array first
- Launch all workers in parallel with background jobs (&)
- Wait for each job in sequence, tracking results

Also removed dead code: launch_worker() and launch_pool_workers()
functions (replaced by inline parallel launch), and get_work_number()
and get_work_type() helpers (no longer needed).
2026-05-12 18:17:29 +00:00
freemo f36e319c88 build: fix opencode-builder.sh crash and work-item discovery
- resolve_forgejo_config: fall back to git remote origin when
  FORGEJO_OWNER/FORGEJO_REPO are not set in env vars
- busy_count: count directly in the tag loop instead of a broken
  grep-pipeline that caused '0: syntax error' when count was zero
- Remove the now-dead launch_supervisor function and SUPERVISOR_TIMEOUT
  (already removed from loop in prior commit)
2026-05-12 16:50:07 +00:00
freemo 056d0c19a7 build: eliminated supervisors and uses the script directly now to launch 2026-05-12 12:17:47 -04:00
freemo d208dfdc92 build: increaased implementation supervisor timeout 2026-05-12 10:53:24 -04:00
freemo a711900adb build: fixed some issues with opencode-builder.sh 2026-05-11 17:58:33 -04:00
freemo ea8371fb1f build: fixed broken script 2026-05-11 17:51:43 -04:00
freemo e971f18f40 build: first attempt to move more of the pool management into the script 2026-05-11 17:51:43 -04:00
clever-agent 11218dcd65 build: improved the startup script for auto-agents 2026-05-11 17:48:43 -04:00
clever-agent 6fcb352c48 build: changed permission on auto-agents script 2026-05-11 17:48:43 -04:00
freemo 97ea5a26d8 script: reinforced auto-agent scripts
CI / status-check (push) Blocked by required conditions
CI / benchmark-publish (push) Waiting to run
CI / push-validation (push) Successful in 40s
CI / helm (push) Successful in 53s
CI / build (push) Successful in 1m7s
CI / quality (push) Successful in 1m31s
CI / lint (push) Successful in 1m37s
CI / typecheck (push) Successful in 1m39s
CI / security (push) Successful in 1m46s
CI / integration_tests (push) Successful in 4m40s
CI / e2e_tests (push) Successful in 5m10s
CI / unit_tests (push) Successful in 7m10s
CI / docker (push) Waiting to run
CI / coverage (push) Has started running
2026-05-02 14:02:26 -04:00
HAL9000 514d61c63c build: fixed script to work with agent changes
CI / helm (push) Successful in 36s
CI / push-validation (push) Successful in 27s
CI / benchmark-publish (push) Failing after 59s
CI / lint (push) Successful in 57s
CI / build (push) Successful in 54s
CI / quality (push) Successful in 1m21s
CI / security (push) Successful in 1m37s
CI / typecheck (push) Successful in 1m37s
CI / integration_tests (push) Failing after 3m37s
CI / e2e_tests (push) Successful in 3m45s
CI / unit_tests (push) Failing after 4m48s
CI / docker (push) Has been skipped
CI / coverage (push) Successful in 11m2s
CI / status-check (push) Failing after 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 42s
CI / build (pull_request) Successful in 1m1s
CI / lint (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m43s
CI / typecheck (pull_request) Successful in 1m46s
CI / quality (pull_request) Successful in 1m45s
CI / integration_tests (pull_request) Failing after 3m53s
CI / e2e_tests (pull_request) Successful in 4m46s
CI / unit_tests (pull_request) Failing after 4m58s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m32s
CI / status-check (pull_request) Failing after 3s
2026-04-27 13:02:32 -04:00
HAL9000 fe30961990 build: Updated script to match the new agent code
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / push-validation (push) Waiting to run
CI / status-check (push) Blocked by required conditions
CI / unit_tests (push) Has started running
CI / benchmark-publish (push) Failing after 39s
CI / lint (push) Successful in 1m6s
CI / typecheck (push) Successful in 1m17s
CI / quality (push) Successful in 1m45s
CI / security (push) Successful in 2m27s
CI / coverage (push) Waiting to run
CI / build (push) Successful in 36s
CI / integration_tests (push) Failing after 7m7s
CI / e2e_tests (push) Successful in 8m2s
2026-04-27 12:52:51 -04:00
freemo f2fc8f771e feat: add port checking to opencode-builder script
CI / build (push) Successful in 18s
CI / push-validation (push) Successful in 19s
CI / lint (push) Failing after 24s
CI / helm (push) Successful in 23s
CI / quality (push) Successful in 32s
CI / security (push) Successful in 59s
CI / typecheck (push) Successful in 1m7s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / e2e_tests (push) Successful in 3m4s
CI / integration_tests (push) Failing after 4m4s
CI / unit_tests (push) Successful in 5m9s
CI / docker (push) Has been skipped
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Has been cancelled
- Add check_opencode_running() function to detect existing OpenCode server
- Skip server startup if OpenCode already running on target port
- Display prominent warning when connecting to existing server
- Only manage server lifecycle when script starts its own server
- Add OWN_SERVER flag to track server ownership
- Update cleanup logic to leave existing servers running

This enables multiple developers and automation scripts to safely
run in parallel without conflicting server management.
2026-04-08 19:57:54 -04:00
freemo 73afe58cfe build: runner for opencode project-builder
CI / benchmark-publish (push) Waiting to run
CI / lint (push) Successful in 34s
CI / quality (push) Successful in 41s
CI / typecheck (push) Successful in 48s
CI / security (push) Successful in 1m5s
CI / benchmark-regression (push) Waiting to run
CI / build (push) Successful in 24s
CI / helm (push) Successful in 22s
CI / unit_tests (push) Successful in 7m6s
CI / docker (push) Successful in 20s
CI / coverage (push) Successful in 10m0s
CI / e2e_tests (push) Successful in 16m13s
CI / integration_tests (push) Successful in 22m44s
CI / status-check (push) Successful in 1s
2026-04-05 01:09:18 -04:00