Skip to content

Have an agent summarize a refused wave

llms.txtlists every page for an agent
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).

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.

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
  1. Store the key as a secret named ANTHROPIC_API_KEY.

    A repository secret under Settings, Secrets and variables, Actions.

    The model’s command gets that key and the process basics, and no other secret of the job.

  2. Turn it on in terragucci.yml:

    respond:
    wave-refused: summary

    To read the key from another secret and cap the runs:

    respond:
    wave-refused: summary
    agent:
    wave-refused:
    key_secret: MODEL_KEY
    max_runs: 10
    max_cost_usd: 5
    timeout: 10

    The refused-wave summary lists each key and its default. The note goes out with the wave job’s own token, so agent.wave-refused takes no via or token_env.

  3. Write the pipeline again and merge it.

    Terminal window
    npx terragucci config check
    npx terragucci init

    Each apply-wave-<k> job then carries the summary’s settings as CHANT_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.

A repo that added the explain-refusal job under own_jobs gets the same summary from chant’s wave job:

  1. Set respond.wave-refused: summary, and agent.wave-refused.key_secret when the job read the key from a secret other than ANTHROPIC_API_KEY.

  2. Delete the explain-refusal job from the own-jobs file. Leave own_jobs set if the file holds other jobs; otherwise remove the key and the file.

  3. Commit the edited file with the pipeline npx terragucci init writes.

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.

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.