Settings commands
People with write, maintain or admin access from GitHub's permission API can ask Code Hawk to change settings from a comment on an issue or a pull request. Put one command on the first line of a new comment. Leading blank lines are allowed. Keywords ignore case and extra spaces. Model names and Cloudflare IDs keep the case you type.
@codehawk-app settings model <provider> <model>@codehawk-app settings model cloudflare <account-id> <gateway-id> <upstream> <model>@codehawk-app settings job <job> <model>@codehawk-app settings job <job> default@codehawk-app settings cap <cap> <usd>@codehawk-app settings cap <cap> none@codehawk-app settings helpThe five forms are model, Cloudflare model, job, cap and help. Direct providers and Cloudflare upstreams are openai, anthropic and google. Models must come from the same priced lists as the setup page. Use help to see the current lists.
Jobs are pr_review, pr_summary, pr_reply, weekly_security, weekly_bug, weekly_confirm, fix_issues, flows_plan, flows_driver and flows_diagnosis. A job that sets its own provider in the file must be edited by hand. Weekly confirmation needs a different model from the weekly finders.
Caps are pr_review, pr_reply, weekly, fix_issues, fix_issues_per_issue and flows. Amounts are US dollars above 0 and at most 10000, with up to two decimal places. none removes a cap. default removes a job's model override. Cloudflare account and gateway IDs use up to 64 letters, digits, underscores or dashes each.
Code Hawk opens a pull request titled Update Code Hawk settings from codehawk/setup, or adds a commit to the open setup pull request. It changes .github/codehawk.json only. If only the legacy .github/codereview-hawk.json exists, the same commit moves its content to the new name and deletes the old file. Other keys stay in the file. Nothing applies before a person reviews and merges the pull request. The setup page adds to the same pull request. An existing setup branch without an open pull request is refused. If settings move during a command, post the command again.
The App commits on top of whatever the open codehawk/setup branch already holds. Since the App opens the pull request, the person who requested the change can approve it. Repositories that need a second reviewer should use CODEOWNERS or branch protection.
Comments from bots are ignored without a reply. Events for edited and deleted comments are ignored. Before acting, Code Hawk reads the live comment again. A deleted command does nothing and a changed command is refused. Fork pull requests, including deleted forks, are refused. Post on an issue or on a pull request from the same repository instead.
Each repository can receive at most 10 settings changes per hour. After 30 settings replies in an hour, Code Hawk stays silent for non-writers. Writers can still change settings and receive replies. At the change limit, it replies with a request to try later. Help still works at the change limit.
The settings-command.yml token slice is contents write, pull_requests write, issues write, never workflows. It runs on issue_comment only. The caller needs id-token: write only. The settings job has no checkout or model keys. Keys stay in Actions secrets and never belong in a comment. A caller using another config_path must edit its file by hand.
Caller
Section titled “Caller”Replace <sha> and <version> with a released Code Hawk commit and version. New installation setup pull requests already include this job.
name: Code Hawk settings
on: issue_comment: # zizmor: ignore[dangerous-triggers] comment jobs check write access and never check out pull request code types: [created]
permissions: {}
jobs: settings: permissions: id-token: write uses: bts-io/codehawk/.github/workflows/settings-command.yml@<sha> # codehawk <version>