Have an agent summarize a refused wave
Optional: hand this page to your coding agentThe steps work by hand too.Show the whole prompt
Read https://intentius.io/terragucci/guides/agent-refused-wave/.
Set respond.wave-refused to summary in terragucci.yml, with agent.wave-refused if the key's secret has another name,
run `npx terragucci config check` and `npx terragucci init`, and open a pull request.
Tell me which secret I must create. Do not create it.
Never apply, approve (a pull request review or `terragucci approve`), override a policy denial (`terragucci override`), use `--mode apply`, or merge; never touch `.chant/allowed_signers` or `chant/lifecycle`.One of four features that run a model; the others are the /terragucci agent comment, the drift agent and the pull request review. It is off until respond.wave-refused is summary; every other feature runs without an agent (what needs an agent).
Result
Section titled “Result”When a wave applies nothing because its plans moved after their approval, the note on it holds the diff between the approved plans and the current ones, as respond.wave-refused: diff posts it, with a model’s summary of what moved above it. chant’s wave job runs the model and posts the note. The model approves nothing and merges nothing, and the summary changes no exit code.
Prerequisites
Section titled “Prerequisites”| You need | Why |
|---|---|
| Fix a refused wave done once by hand | the summary reads the same diff you print there |
| An API key for the model | the wave job runs Claude Code, or the command you name |
-
Store the key as a secret named
ANTHROPIC_API_KEY.A repository secret under Settings, Secrets and variables, Actions.
A masked CI/CD variable. Protect it when only the default branch applies.
The same as GitHub; Forgejo keeps them under Settings, Actions, Secrets.
The model’s command gets that key and the process basics, and no other secret of the job.
-
Turn it on in
terragucci.yml:respond:wave-refused: summaryTo read the key from another secret and cap the runs:
respond:wave-refused: summaryagent:wave-refused:key_secret: MODEL_KEYmax_runs: 10max_cost_usd: 5timeout: 10The refused-wave summary lists each key and its default. The note goes out with the wave job’s own token, so
agent.wave-refusedtakes noviaortoken_env. -
Write the pipeline again and merge it.
Terminal window npx terragucci config checknpx terragucci initEach
apply-wave-<k>job then carries the summary’s settings asCHANT_WAVE_SUMMARY_*variables, with the key from its secret.
A summary that fails, or one past a day’s limit, leaves the diff alone in the note with the reason the summary was skipped. Each run that starts the command leaves one record on chant/lifecycle under op terragucci-refused-wave, with the prompt’s digest, the model and its cost (agent runs).
Read the summary and choose between approving the new plan and reverting the change. The choice and the approval (terragucci approve) are yours.
Move from an explain-refusal job
Section titled “Move from an explain-refusal job”A repo that added the explain-refusal job under own_jobs gets the same summary from chant’s wave job:
-
Set
respond.wave-refused: summary, andagent.wave-refused.key_secretwhen the job read the key from a secret other thanANTHROPIC_API_KEY. -
Delete the
explain-refusaljob from the own-jobs file. Leaveown_jobsset if the file holds other jobs; otherwise remove the key and the file. -
Commit the edited file with the pipeline
npx terragucci initwrites.
On every forge the summary is now in the note on the wave. On GitHub it was a comment of its own, and on GitLab and Forgejo it stayed in the job log. chant writes the run record, so the terragucci agent record step goes with the job, and so does the forge token the job commented with.
MCP or --json
Section titled “MCP or --json”| Where the agent runs | What it uses |
|---|---|
| a job of your own | respond wave-refused --json from the shell, on the wave’s artifact terragucci-report-apply-wave-<k>, which holds approved/report.json and current/report.json when refused |
| at your desk | terragucci mcp: run_view for where each wave of the commit stands, report for the refused wave’s report, and waiting for each wave that waits for an approval, with the command a person runs to approve it |
terragucciHelp setting it up: Intentius
These docs count page views and clicks with PostHog. They set no cookies, store nothing in your browser, and send nothing when your browser asks not to be tracked.