Skip to content

fix(hourly-loop): route OpenCode hourly maintenance agent to orchestrator/free - #1013

Closed
seonghobae wants to merge 3 commits into
mainfrom
fix/hourly-loop-orchestrator-free
Closed

fix(hourly-loop): route OpenCode hourly maintenance agent to orchestrator/free#1013
seonghobae wants to merge 3 commits into
mainfrom
fix/hourly-loop-orchestrator-free

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Org-wide audit into whether every ContextualWisdomLab GitHub Actions workflow that makes an LLM call routes through contextual-orchestrator's orchestrator/free pool found that this repository's own hourly maintenance loop (.github/workflows/opencode-hourly-loop.yml, cron: "23 * * * *") was still requesting orchestrator/auto — the paid-inclusive pool — in both:

  • the generated ~/.config/opencode/opencode.json model field, and
  • the opencode run --model CLI argument.

ADR-0003 in ContextualWisdomLab/.github (docs/adr/0003-contextual-orchestrator-vendored-free-zdr.md) already moved OpenCode, Noema, and (as of its 2026-08-30 amendment) Strix off orchestrator/auto and onto the fail-closed zero-cost orchestrator/free pool for the three central review workflows. That ADR's stated scope is explicitly "ContextualWisdomLab/.github central review pipelines" — this repository's own self-referential hourly dev loop was out of scope for that document and was missed. The org owner has since directed that all Actions workflows use orchestrator/free.

Change

Two call sites changed from contextual_orchestrator_gateway/orchestrator/auto to contextual_orchestrator_gateway/orchestrator/free, plus the models block key in the generated config. The sidecar's own auto-discovery (--auto-discover-model-agents) and provider credential wiring are unchanged — this only changes which virtual pool the client requests. Updated the pinned contract test (tests/test_hourly_opencode_loop_contract.py) to match and renamed it to reflect the pool it now asserts.

Developer experience

actionlint passes clean on the changed workflow file. uv run --with pytest pytest tests/test_hourly_opencode_loop_contract.py -q passes (1 passed). No other test references this workflow file or its prompt.

User experience

No user-facing change. Scheduled hourly maintenance runs on this repository can no longer incur a paid-model cost; behavior otherwise unchanged (provider auto-discovery, credential handling, PR queue logic, and the maintenance prompt are untouched).

Test plan

  • actionlint .github/workflows/opencode-hourly-loop.yml
  • uv run --with pytest pytest tests/test_hourly_opencode_loop_contract.py -q
  • CI on this PR (required checks)

🤖 Generated with Claude Code


Devin Review

…ator/free

The hourly self-referential dev loop (cron 23 * * * *) requested
orchestrator/auto in both the generated opencode.json and the
`opencode run --model` CLI argument, admitting priced fallback routes.
ADR-0003 already moved every ContextualWisdomLab/.github central review
path (OpenCode, Noema, Strix) off orchestrator/auto and onto the
fail-closed zero-cost orchestrator/free pool; this loop was out of that
ADR's stated scope and was missed. Switch both call sites to
orchestrator/free so no scheduled agent run in this repository can incur
a paid model cost, and update the pinned workflow contract test to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 769379c6-8840-443c-a868-a4290a3fc014


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the current exact head 0a800f87c6df8bb310e1a09859f44d5451fcc969; prior CodeRabbit attempt was rate-limited and did not produce a current-head review. Scope is the orchestrator/free GitHub Actions contract change and its regression only.

Copy link
Copy Markdown
Contributor Author

Current merge blocker is not a demonstrated defect in this two-file diff; it is missing exact-head required evidence. Fresh repository-wide Actions sampling shows the same GitHub-hosted queue starvation on unrelated heads (#971@6fed18c, #983@7652707), while this PR's Tests/Fuzz/Security/Security Scan/SAST runs remain queued without jobs starting. Tests uses ubuntu-latest, so do not rewrite this PR around a nonexistent self-hosted-runner dependency or treat old/cancelled evidence as GREEN.

The organization owner path is existing .github#712 (ops: diagnose and bound organization GitHub Actions queue starvation); fresh contextual-orchestrator run IDs and acceptance evidence have been handed off there. Keep this PR open and unchanged unless a real current-head review finding appears. Merge only after current-head required checks actually execute and terminate successfully plus the normal independent review/protection requirements. Do not rerun-storm queued workflows, bypass checks, self-approve, or add temporary source-fix workflows.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested_head='0a800f87c6df8bb310e1a09859f44d5451fcc969'

echo '== Checked-out commit =='
git rev-parse HEAD
git show -s --format='commit=%H%nparents=%P%nsubject=%s' HEAD
if [[ "$(git rev-parse HEAD)" != "$requested_head" ]]; then
  echo "ERROR: expected ${requested_head}" >&2
  exit 2
fi

echo
echo '== Changed files against first parent =='
git diff --name-status HEAD^ HEAD
echo
echo '== Complete diff =='
git diff --no-ext-diff --unified=80 HEAD^ HEAD -- \
  .github/workflows/opencode-hourly-loop.yml \
  tests/test_hourly_opencode_loop_contract.py

echo
echo '== Workflow structure =='
ast-grep outline .github/workflows/opencode-hourly-loop.yml --items all || true
echo
echo '== Contract-test structure =='
ast-grep outline tests/test_hourly_opencode_loop_contract.py --items all || true

echo
echo '== Direct model-pool and workflow references =='
rg -n -C 4 \
  -e 'contextual_orchestrator_gateway/orchestrator/(auto|free)' \
  -e 'opencode-hourly-loop\.yml' \
  .github tests

Length of output: 12959


@seonghobae: I reviewed commit 0a800f87c6df8bb310e1a09859f44d5451fcc969.

I found one regression-test gap.

  • tests/test_hourly_opencode_loop_contract.py checks the two fully qualified contextual_orchestrator_gateway/orchestrator/free requests.
  • The test does not check the generated provider registry key: "orchestrator/free".
  • If that key is removed or changed later, the test can still pass while the OpenCode configuration is incomplete.

Add an assertion for the provider model key, for example:

assert '"orchestrator/free": { "name": "fail-closed zero-cost orchestration" }' in workflow

The workflow changes correctly update both fully qualified model requests to orchestrator/free.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

seonghobae pushed a commit that referenced this pull request Sep 2, 2026
Ports #1006's decision record onto this branch's already-corrected fix
(the removed job-level model deadline and orchestrator/free pin) so the
two overlapping PRs converge on one canonical successor instead of
duplicating the same underlying repair:

- docs/adr/0007-hourly-loop-orchestrator-free-pool-pin.md: #1006's ADR,
  carried over unchanged. Its body already reads `Status: Proposed`.
- docs/adr/README.md: register the ADR-0007 row as `Proposed`, matching
  the body -- the Proposed/Accepted mismatch a review comment flagged
  on #1006 was between an earlier ADR draft and its index row; #1006's
  current head had already corrected both to `Proposed` before this
  port, so no repair was needed here beyond carrying the agreement
  forward.
- .github/workflows/opencode-hourly-loop.yml: restore #1006's top-of-file
  comment block explaining the orchestrator/free vs. auto-discovery
  distinction and pointing at ADR-0007, plus a note on the no-job-deadline
  policy this PR already implements.
- tests/test_hourly_opencode_loop_contract.py: port #1006's ADR-content
  test, and add a new
  test_adr_0007_body_and_index_status_agree_and_stay_proposed_while_open
  acceptance-criteria test that parses both the ADR body `Status:` line
  and the docs/adr/README.md index row and fails if they disagree, or if
  either reads anything but `Proposed` while the decision is open. This
  is the regression test the review comment asked for so the
  body/index contradiction it found on #1006 cannot recur silently, here
  or on any future ADR.

#1013 was compared against this diff and #1006's: its only content is
the same orchestrator/auto -> orchestrator/free workflow/test edit,
already present here and in #1006, with no ADR, no job-deadline fix, and
no additional test coverage -- it carries no delta this PR is missing.

Verified: tests/test_hourly_opencode_loop_contract.py (4 passed),
interrogate 100% on the modified test file, workflow YAML parses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4

Copy link
Copy Markdown
Contributor Author

Reconciling this PR against #1027 and #1006, which overlap on the same orchestrator/free workflow fix.

I diffed this PR's changes against both: the entire content here — the orchestrator/autoorchestrator/free pin at the two call sites plus the matching contract-test update — is already present in #1027 (fix/hourly-loop-job-timeout-cap, current head 3788cf8), which additionally removes the caller-authored timeout-minutes: 55 job-level cap this PR leaves untouched, and carries an ADR (docs/adr/0007-hourly-loop-orchestrator-free-pool-pin.md) documenting the decision. This PR carries no delta that #1027 is missing.

#1027 now supersedes this PR. I have not closed this PR — per this org's PR-closure discipline, that's for the queue owner to do once #1027 actually merges, not for me to do unilaterally.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Successor landed — no remaining independent delta

Protected main contains successor #1027 at f4e5fc67dfcb7ddb1afb004a06417e915afb9826.

This PR's complete scope—both OpenCode model call sites, the local model catalog key, and the free-pool contract test—is present in that successor. #1027 additionally removes the unsupported elapsed-time cap, adds ADR traceability, and strengthens fail-closed contract coverage.

Closure is based on complete successor inheritance, not on treating the change as unnecessary or discarding its delta.

@seonghobae seonghobae closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI, GitHub Actions, checks, release, or supply chain bug Something isn't working priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant