Think of the agent system as a small factory.
- agent-vshn-todo is the private suggestion inbox or backlog: every new idea, bug report, or improvement request lands there as an issue.
- agent-vshn-runner is the automated factory floor: it reads the inbox on a schedule, picks the oldest unclaimed request, runs an agent pipeline, and opens a pull request with the proposed implementation.
This repository is the public half of that pair: it contains the worker workflows that keep the factory running.
| Repository | Visibility | Purpose | Notes |
|---|---|---|---|
| bacluc-agent/agent-vshn-todo | private | Holds the issue backlog | New ideas and bug reports are filed here |
| bacluc-agent/agent-vshn-runner | public | Holds the worker workflows | Issues are disabled here; work is tracked in agent-vshn-todo |
┌─────────────────────────────────┐
│ Issue opened in │
│ agent-vshn-todo │
└────────────┬────────────────────┘
│ every hour
▼
┌─────────────────────────────────┐
│ hourly-issue.yml │
│ picks oldest open, unclaimed │
│ issue │
└────────────┬────────────────────┘
│
▼
┌─────────────────────────────────┐
│ issue-selector chooses one │
│ issue to implement │
└────────────┬────────────────────┘
│
▼
┌─────────────────────────────────┐
│ coordinator delegates the work │
└────────────┬────────────────────┘
│
▼
┌─────────────────────────────────┐
│ agent pipeline │
│ • planner writes a plan │
│ • refiner checks the plan │
│ • build writes the code │
│ • tester verifies the change │
│ • reviewer reviews the result │
└────────────┬────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Pull request opened in the │
│ target repository │
└────────────┬────────────────────┘
│
┌────────┴────────┐
│ │
▼ ▼
human review review-fixes.yml
and feedback applies review comments
│ │
└────────┬────────┘
│
▼
PR merged
.github/workflows/hourly-issue.yml runs the first half of the cycle.
- Schedule: every hour at 24 minutes past the hour (
24 * * * *), plus manual runs. - What it does:
- Searches
agent-vshn-todofor the oldest open issue that does not have theagent-runninglabel. - Uses the
issue-selectoragent to choose one issue from the candidate list. - Adds the
agent-runninglabel so the same issue is not picked again. - Dispatches
.github/workflows/opencode.ymlwith the selected issue as a prompt.
- Searches
The agent-running label is the factory's claim ticket: it prevents duplicate runs on the same issue.
.github/workflows/review-fixes.yml keeps existing pull requests moving.
- Schedule: every 4 hours at 32 minutes past the hour (
32 */4 * * *), plus manual runs. - What it does:
- Scans open pull requests in the issue repository for review comments from
@Baclucor@bacluc-agent. - Generates a prompt for each PR that asks the agent to apply the review comments.
- Dispatches
.github/workflows/opencode.ymlin parallel for each PR.
- Scans open pull requests in the issue repository for review comments from
The work is done by OpenCode agents defined in the OpenCode configuration pulled from provision-machines. The agents play the following roles:
| Agent | Role |
|---|---|
issue-selector |
Picks the most valuable issue to work on next |
model-discovery |
Chooses a reachable AI model for the current task |
coordinator |
Delegates work to the other agents and keeps the run on track |
planner |
Produces a step-by-step implementation plan |
refiner |
Reviews and tightens the plan before code is written |
build |
Writes the code and tests |
tester |
Runs tests and verifies the change works |
reviewer |
Reviews the final pull request |
Before each run the .github/actions/model-availability action checks which AI models are currently reachable.
- Free models are listed first in the availability output and are preferred when no specific model is requested.
- The coordinator is only auto-assigned a model from the cheap list;
vshn-us-ai/subscription.qwen3.8-maxis never selected automatically and is only used when it is passed explicitly asmodelormodel_choice. - Results are cached in a GitHub issue titled "model-discovery cache" inside
agent-vshn-todo. - A model that passed its last check is trusted for 24 hours.
- A model that failed is retried after 2 hours.
- If a coordinator run fails, the model used for that run is marked as failed in the cache.
Run the completion check before pushing:
./scripts/completion-checkThe script runs Prettier and actionlint inside Docker. The same check runs automatically on every push and pull request via .github/workflows/ci.yml.
- Issue: bacluc-agent/agent-vshn-todo#5 — "Make sure authenticating to VSHN_US_AI works"
- Pull request: bacluc-agent/agent-vshn-runner#1 — "Fix VSHN_US_AI authentication in model discovery" (merged)
What happened: The workflow that asks VSHN_US_AI "which models do you have?" was not sending the API key. The provider returned 401 Unauthorized. The fix passes the API key as a Bearer token.
Code change in .github/actions/model-availability/model_availability.py:
-def fetch_model_ids(endpoint: str) -> list[str]:
- """GET the v1/models endpoint with curl User-Agent + x-opencode-session; [] + warning on failure."""
+def fetch_model_ids(endpoint: str, api_key: str | None = None) -> list[str]:
+ """GET the v1/models endpoint with curl User-Agent, x-opencode-session, and optional Authorization; [] + warning on failure."""
try:
session_id = os.urandom(16).hex()
- request = urllib.request.Request(
- endpoint,
- headers={"x-opencode-session": session_id, "User-Agent": "curl/8.5.0"},
- )
+ headers = {"x-opencode-session": session_id, "User-Agent": "curl/8.5.0"}
+ if api_key:
+ headers["Authorization"] = f"Bearer {api_key}"
+ request = urllib.request.Request(endpoint, headers=headers)A matching test was added to prove the key is sent, in .github/actions/model-availability/test_model_availability.py:
+ monkeypatch.setenv("VSHN_US_AI_API_KEY", "test-key")
...
+ assert captured["headers"].get("Authorization") == "Bearer test-key"- Issue: bacluc-agent/agent-todo#80 — "Enable the free models to use the BACLUC_AGENT_GITHUB_TOKEN"
- Pull request: bacluc-agent/agent-todo#87 — "fix(workflow): use BACLUC_AGENT_GITHUB_TOKEN for checkout to enable free model pushes" (merged)
What happened: The cheaper free models were checking out the repository with the default GITHUB_TOKEN, which does not have permission to push code. Switching the checkout step to use BACLUC_AGENT_GITHUB_TOKEN gave them the push permission they needed. This example is from the remote bacluc-agent/agent-todo repository, which uses the same runner setup.
Code change in .github/workflows/opencode.yml:
- name: Checkout
uses: actions/checkout@v4
with:
repository: bacluc-agent/agent-todo
fetch-depth: 0
- token: ${{ secrets.GITHUB_TOKEN }}
+ token: ${{ secrets.BACLUC_AGENT_GITHUB_TOKEN }}| Term | Meaning |
|---|---|
| Issue | A ticket that describes a bug, idea, or task. Issues live in agent-vshn-todo. |
| PR / Pull request | A proposed set of changes submitted for review before merging into the codebase. |
| Workflow | A GitHub Actions automation definition. This repository contains hourly-issue.yml, review-fixes.yml, opencode.yml, and ci.yml. |
| Agent | An AI role that performs a specific step, such as selecting an issue, planning, building, testing, or reviewing. |
| OpenCode | The command-line tool that runs the agents. |
| Model | An AI model the agents can call, for example a free model or a VSHN_US_AI model. |
| Model-availability cache | A GitHub issue in agent-vshn-todo that remembers which models were recently reachable. |
| Completion check | The local quality check script (./scripts/completion-check) that runs Prettier and actionlint. |
| Issue repository | The repository that holds the backlog, configured with the ISSUE_REPOSITORY variable. Defaults to the current repository. |
Repository variables:
ISSUE_REPOSITORY: repository that holds the issues (defaults to this repository)MODEL_AVAILABILITY_CACHE_ISSUE: issue number of the model-discovery cache (auto-detected by title when unset)VSHN_US_AI_BASE_URL: base URL of the vshn-us-ai provider (required to use VSHN_US_AI models)
Repository secrets:
BACLUC_AGENT_GITHUB_TOKEN: PAT with access to the issue repositoryVSHN_US_AI_API_KEY: API key for the vshn-us-ai providerBRAVE_API_KEY: API key for the Brave Search MCP server (optional)
The OpenCode CLI version is pinned in .github/actions/setup-opencode/action.yml and updated by Renovate.