Run a real agent loop: scope the job, let the model call tools, review every change, and stop when done. Includes common failure modes.
Run One Real Job
Theory does not teach this. With the agent already pointed at the Gab AI API (previous lesson: Settings → API, base URL https://gab.ai/v1), pick a task you would have done yourself in under an hour: a failing test, a copy change in a known file, a research brief that should produce a markdown note with sources.
Then run the loop on purpose — not as background magic you hope is correct.
If the CLI still has an OpenAI or Anthropic key, stop
Wire Gab AI first. Create a key under Settings → API, set the base URL to https://gab.ai/v1 (Claude Code: https://gab.ai), and pick a function-calling Gab model or auto. The rest of this lesson assumes that.
Failure Modes You Will Hit
These are not edge cases. They are the default unless you watch.
You still own the merge
An agent can open a PR. It cannot be blamed for it. Read the diff, run the tests locally, and keep secrets out of the transcript. Treat auto-approve as a setting for people who enjoy restoring from git.
Capture What Worked
When a loop goes well, do not leave the brief in chat history. Put the constraints into a Gab custom agent, a repo AGENTS.md, or the CLI's project instructions so the next run starts from the same fences.
That is the connection back to the rest of this course: prompting, being specific, and iterating still apply. The agent just has hands.
If the CLI still has an OpenAI or Anthropic key, stop
Wire Gab AI first. Create a key under Settings → API, set the base URL to https://gab.ai/v1 (Claude Code: https://gab.ai), and pick a function-calling Gab model or auto. The rest of this lesson assumes that.
1. Confirm the model can use tools — In Pi, Hermes, Cursor, or OpenCode, select a Gab AI model with function calling (or auto, which sticks for the rest of that tool loop). If the first reply is a plan with no tool calls, switch models before you continue.
2. Paste the brief, then watch the first tools — The first three tool calls tell you whether the agent understood the job. If it lists the wrong directory or starts rewriting unrelated files, interrupt immediately.
3. Review every diff — Do not auto-accept a 20-file change. Read it like a pull request: is this the smallest change that meets the definition of done? If not, reject and restate the fence.
4. Let it verify — A good agent re-runs the test, the build, or the grep you named as done. If it declares victory without running the check, tell it to run the check. Victory is a command, not a paragraph.
5. Stop on purpose — When done is true, say so and end the session. When it is not true after two serious attempts, stop, capture what failed, and either tighten the brief or do the remaining step yourself. Endless loops are how credits disappear.
The retry spiral — Same command, same error, third time. Interrupt. The agent does not get smarter by repeating a failed bash line. Change the approach or do that step yourself.
The wrong tree — It is editing a nested copy of the repo, a dist/ folder, or someone else's package. Check the working directory on the first tool call.
The context dump — You pasted four files "for context" and now the model is implementing against the paste, not the disk. Point at paths. Let it read.
The model that cannot call tools — Beautiful markdown, zero function calls. Switch to a function-calling model from /v1/models. Coding and agent work on Gab AI's auto router also stick to the model they picked for the rest of that loop — do not fight that by swapping mid-run unless the first pick cannot use tools.
The quiet credit burn — Long reasoning plus many tool calls is expensive. Use a cheaper function-calling model for mechanical edits; save frontier models for the hard diagnosis. Check GET /v1/credits if a run feels stuck.
You still own the merge
An agent can open a PR. It cannot be blamed for it. Read the diff, run the tests locally, and keep secrets out of the transcript. Treat auto-approve as a setting for people who enjoy restoring from git.
Watch the first tool calls. If the agent is in the wrong place, interrupt before the diff exists.
Review every change like a pull request. Done is a command that passed, not a confident paragraph.
Stop after two failed attempts at the same step. Retry spirals waste credits.
Save a brief that worked into an agent or AGENTS.md so you do not re-explain the fences next time.