fix: unbreak label routes; source agent credentials from the runner #19
No reviewers
Labels
No labels
agent
coordinate
agent
dev
agent
plan
agent
reflect
agent
test
agent
triage
ai/off
blocked
night
blocked
usage
loop
1
loop
2
loop
3
needs/approval
needs/human
needs/input
needs/review
plan/approved
run/night
state
blocked
state
building
state
passed
state
planning
state
testing
tier
fable
tier
haiku
tier
local
tier
opus
tier
sonnet
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
valssi-public/agent-workflows!19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/runner-injected-credentials"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the root cause behind #18's
agent/planlabel doing nothing, and removes the need for per-org Forgejo Actions secrets.1. The routes were unparseable (this is the actual bug)
plan.yaml,dev.yaml,test.yaml,coordinate.yamlandreflect.yamlall declaredsecrets:underon.workflow_call. Forgejo's parser accepts onlyinputsandoutputsthere, so every issue event produced five runs that failed before scheduling a single job:(Observed on runs 628–632 and 634–638 in this repo;
dispatch.yamlnever had the block, which is why routing looked healthy.) The declaration is removed —secrets: inheritat the call sites is what actually passes secrets.2. Credentials now come from the runner
Previously every org needed its own
CLAUDE_CODE_OAUTH_TOKEN/CLAUDE_PLAN_PAT/CLAUDE_DEV_PAT/LITELLM_KEY.valssi-aihad them,valssi-publicdid not.New composite action
lib/credentialsresolves each credential in this order:and exports
TOKEN,CLAUDE_CODE_OAUTH_TOKEN,LITELLM_KEYto$GITHUB_ENV.dispatch'stickneeds both PATs at once and overrides the export name viaexport-as.The job-level
env:mappings are deleted rather than reordered:${{ secrets.X }}evaluates to the empty string in an org without that secret, which would shadow the injected value with nothing.lib/preflightnow fails fast on an empty token. Previously an unreadable label list would sail past theai/offkill switch and fail obscurely deep in the route.Ordering
Merge order does not matter — the fallback covers both directions:
Once both are in, the org secrets under
valssi-ai→ Settings → Actions → Secrets can be deleted.Org variables are still per-org and still required —
AGENTS_ENABLEDmust be exactlytrueor preflight no-ops green and leaves no trace on the issue at all.Companion PRs
valssi-ai/forgejo-ai-dev-runner— renders the credentials into the job containersvalssi/komodo-resource-sync— passes them to the prod and dev runner stacksNeeds a manual Komodo apply after the two land.
🤖 Generated with Claude Code
Two independent defects kept `agent/plan` (and every other route) from ever running: 1. plan/dev/test/coordinate/reflect declared `secrets:` under `on.workflow_call`. Forgejo's parser accepts only `inputs` and `outputs` there, so all five files were unparseable — every issue event produced five runs that failed with `preExecutionError: workflow_call only supports keys "inputs" and "outputs", but key "secrets" was found` and zero jobs. Removed; `secrets: inherit` at the call sites is what actually passes them. 2. Credentials had to be duplicated as Forgejo Actions secrets in every org. They now live only in Komodo, which injects them into every job container via the runner. New composite action `lib/credentials` resolves each one — org secret first (per-org override), runner-injected env second — and exports TOKEN / CLAUDE_CODE_OAUTH_TOKEN / LITELLM_KEY to $GITHUB_ENV. The job-level `env:` mappings are gone: `${{ secrets.X }}` is the empty string in an org without that secret, which would shadow the injected value. preflight now fails fast on an empty token instead of sailing past the kill switch with unreadable labels. Requires forgejo-ai-dev-runner to be redeployed with the new Komodo secret variables before the org secrets can be removed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>Pull request closed