AI Coding Agent Troubleshooting Guide
Use this guide when Forge cannot find or authenticate your AI coding agent, cannot load the agent configuration, or fails while the agent runs. Each entry starts with the symptom or exact message. For installation and configuration steps, see AI Coding Agent Setup.
Start with diagnostics
- From the project root, check the project, agent, and toolchain:
frg status --verbose
The output shows the detected project root, the coding agent with its installation and authentication status, any Configuration Warnings:, the toolchain status, and Validation completed in <time>.
- Validate the agent configuration:
frg config validate --file .forge/config/agents.toml
- Reproduce the failure and watch the agent live.
--tailneeds an active job context:
FORGE_ISSUE_ID=42 frg --tail
See Tail Troubleshooting.
-
Read the trace files for the job in
.forge/work/<job_dir>/traces/. -
For more detailed logs, set
RUST_LOG:
RUST_LOG=debug frg issue draft
$env:RUST_LOG="debug"; frg issue draft
- To create a support package, run:
frg diagnose --bundle --include-traces --include-logs --output frg-support.tar.gz
--include-traces and --include-logs add files from the last 24 hours. Use frg diagnose --format json for machine-readable output. See frg diagnose. Remove secrets and confidential prompt content before you share the bundle.
Installation
is not installed or not found in PATH
frg status shows Coding Agent: not installed, followed by this error. For GitHub Copilot the message includes installation hints:
Agent error: GitHub Copilot CLI is not installed or not found in PATH.
Installation:
- Via npm: npm install -g @github/copilot
- Via your package manager
Cause: Forge cannot run the agent's default command (copilot, claude, or opencode) with --version.
Solution:
- Install the agent. See Install an agent.
- Run the command directly, for example
copilot --version. - Add the executable's folder to
PATH, or set an absolutecommandin[agent.<id>].
Verify: frg status --verbose shows the agent name followed by (installation check: <time>).
is not installed or not accessible with Configured command:
Cause: The command override in agents.toml points to a path that does not exist or cannot run.
Solution:
- Check the command path in
.forge/config/agents.toml. - Make sure the command is in your
PATH, or use an absolute path. On Windows, escape backslashes (C:\\path\\to\\copilot.exe) or use forward slashes. - Test the command manually with
--version. - Run
frg status.
'command = "gh"' is not supported.
Full message:
Configuration error for agent 'github_copilot': 'command = "gh"' is not supported.
The 'gh copilot' wrapper has Windows command-line length limitations that cause failures with complex prompts.
Cause: agents.toml sets the GitHub CLI wrapper as the GitHub Copilot command.
Solution:
- Remove the
command = "gh"line from.forge/config/agents.toml. Forge detects the installation automatically, including npm installs. - Or install the standalone CLI with
winget install GitHub.Copilotornpm install -g @github/copilot. - Or set an explicit path, such as
command = "C:\\path\\to\\copilot.exe".
Verify: frg config validate --file .forge/config/agents.toml reports agents.toml — valid.
Note: The dependency check in
frg config validatecan still printInstall with: gh extension install github/gh-copilot. Ignore that hint and install the standalone CLI instead.
CLI not found. Install from: https://code.claude.com/docs/en/setup
Cause: Claude Code is selected, but claude is not installed or not in PATH.
Solution:
- Install Claude Code. See Claude Code CLI.
- Run
claude --version. - Run
frg status --verbose.
Authentication
(not authenticated) in frg status
For GitHub Copilot, Forge reports:
GitHub Copilot CLI is not authenticated.
To fix:
1. Run: gh auth login
2. Follow the authentication prompts
3. Verify with: frg status
For Claude Code, the error includes the agent's exit code and output, for example Claude Code CLI authentication failed (exit code 1), or is not authenticated: detected '<text>' in output. Set ANTHROPIC_API_KEY environment variable.
Cause: The agent's authentication check failed. The session may have expired, the credentials may be missing, or the subscription may be inactive. Forge does not store or refresh agent credentials.
Solution:
- Authenticate the agent as the same user that runs Forge:
- GitHub Copilot: run
copilotand use/login, or setCOPILOT_GITHUB_TOKENto a fine-grained token with the Copilot Requests permission. - Claude Code: sign in, or set
ANTHROPIC_API_KEYin the environment that runs Forge. - OpenCode: complete the provider login.
- Test the agent directly with a short prompt, for example
claude -p "hello"oropencode run hello. - Run
frg status --verbose.
Verify: The status line shows Status: authenticated (auth check: <time>).
frg status reports not authenticated after you set a model
Symptom: frg status reports the agent as not authenticated, but the agent CLI works normally when you run it yourself.
Cause: frg status sends its authentication check using the agent-level model you set in .forge/config/agents.toml. If your agent CLI does not recognize that model name, the CLI returns an error that Forge cannot distinguish from a sign-in failure.
Solution:
- Run
frg config validate. Forge reports a warning when a configured model name is not in its known list for that agent. - Confirm the model name against your agent CLI's own model list.
- Correct the
modelvalue in.forge/config/agents.toml, or remove it so the check sends no model name and the agent CLI uses its own default.
Claude Code users: prefer correcting
modelto a current, valid value over removing it. Older Claude Code CLI versions fall back to an internally retired model ID when no--modelflag is sent, which fails authentication for an unrelated reason (a 404 on the retired model, not a sign-in problem). If you removemodeland authentication still fails, upgrade the Claude Code CLI to a version that no longer references retired model IDs.
Verify:
frg status --verbose
Set FORGE_LOG=debug to see which model Forge used for the check, or that no model name was sent because none is configured.
(transient failure) or (service degraded) in frg status
With (transient failure), Forge also prints The auth probe hit a transient error. Retry the command or check upstream service health.
Cause: The authentication check hit a timeout, a rate limit, or a server error instead of a credential problem. Forge reports these separately from authentication failures, so you do not need to log in again.
Solution:
- Wait, then run
frg status --verboseagain. - Check the agent provider's service status page.
- If the failure persists, test the agent directly with a short prompt.
Note: If the authentication check times out, Forge assumes the agent is authenticated and continues. A slow agent can therefore pass
frg statusand fail later during the workflow.
Configuration
Agent configuration required
Agent configuration required
No agents.toml file found at: <config-path>
Run the following command to configure your AI agent:
frg config init --agent <AGENT_NAME>
Cause: A workflow command ran in a project without .forge/config/agents.toml, or outside the project root.
Solution:
- Change to the project root.
- Generate the configuration:
frg config init --agent claude_code
Replace claude_code with github_copilot or opencode if needed.
Verify: frg status --verbose shows the agent you configured.
Forge uses GitHub Copilot instead of the configured agent
Cause: One of the following:
agent.defaultnames an unknown agent, for example a misspelled ID or an agent that is no longer supported. Forge falls back to GitHub Copilot, andfrg config validatestill reports the file as valid.agents.tomlhas a TOML syntax error or no[agent] default.frg config validatelistsagents.toml — absent, and Forge uses GitHub Copilot.- The command passes
--agent.
Solution:
- Set
defaulttoclaude_code,github_copilot, oropencode, spelled exactly. - Check the TOML syntax, including brackets and quotes, and make sure
schema_versionand[agent] defaultare present. - Remove
--agentfrom the command, or set it to the agent you want.
Verify: frg config validate --file .forge/config/agents.toml lists agents.toml — valid, and frg status --verbose shows the expected agent.
Empty command string for agent '' or contains shell operators
Cause: A command value is empty or contains shell operators such as && or ||. Validation marks agents.toml as invalid.
Solution:
- Remove the
commandline, or set it to a single executable name or absolute path. - Put wrapper logic in a script and point
commandat the script.
Validation warnings about models or custom agents
frg status --verbose lists these under Configuration Warnings:, and frg config validate lists them under Warnings:. They do not block execution.
Cause and solution:
- Model warnings about an empty, overlength, or structurally invalid name: see Model name validation. Forge does not warn based on a vendor model catalog; the agent CLI reports unavailable models.
- Custom-agent warnings (
Empty custom agent string,Invalid custom_agent_operations key): see Custom agent troubleshooting.
TOML parsing error, Invalid configuration at, or Validation error
Cause: A configuration file has invalid TOML (TOML parsing error: <message>), an invalid value at a known location (Invalid configuration at <file>:<line>: <message>), or a semantic problem (Validation error: <message>).
Solution:
- Open the file and line named in the error.
- Check quotes, brackets, table names, and value types.
schema_version is requiredandagent.default is requiredmean a required key is missing. - Run
frg config validateagain.
Toolchain: Missing (REQUIRED)
Cause: .forge/config/toolchain.toml does not exist. frg status still completes, but workflows that use the issue tracker or code platform cannot run.
Solution:
- Generate the toolchain configuration:
frg config init --agent github_copilot --issues github_issues --code github
See Toolchain Configuration for other values.
Verify: frg status --verbose no longer shows Missing (REQUIRED).
Error: Prompt override file not found
Error: Prompt override file not found
Declared: [[prompt_overrides]] target="<target>" operation="<operation>" <role|task>="<name>"
Expected: <expected-path>
The configuration declares a custom <role|task> prompt, but the file doesn't exist.
Cause: .forge/config/commands.toml declares a prompt override, but the file does not exist at the expected path. The path depends on the selected prompt format.
Solution:
- Create the prompt file at the
Expected:path, or runfrg config export --promptsto export the built-in prompts. - Or remove the
[[prompt_overrides]]entry from.forge/config/commands.toml. - If your files are in the other format, set
prompt_formatfor the agent, target, or operation.
Verify: Run the command with --print-prompt to compile the prompt without running the agent.
Execution
Agent error: during a workflow
The error starts with Agent error:. It can include execution failed: and the agent's stderr after Agent stderr:.
Cause: The agent process exited with an error. Common causes are a model the provider does not offer, an expired session, a network failure, or a problem in the prompt or repository.
Solution:
- Read the complete error and the agent's stderr.
- Open the trace for the job in
.forge/work/<job_dir>/traces/. - Check the selected model, custom agent, and prompt format against your intended configuration.
- Test the agent directly with a short prompt.
- Fix the problem, then run the command again. If the agent finished but some outputs are missing, use
--retryto continue the session instead of starting over.
Transient agent failures and automatic retries
A command pauses and then succeeds, or it fails with a message such as This error may resolve on retry. or This is likely a temporary issue with the agent's upstream service. The operation may succeed if retried.
Cause: The agent hit a transient error, such as a timeout, HTTP 429, a 5xx server error, service unavailability, or an invalid response. Forge retries these automatically with exponential backoff. It does not retry authentication failures or configuration errors, because retrying would not fix them.
Solution:
- Wait and run the command again.
- Check the provider's service status.
- Tune retries for your environment with
FORGE_RETRY_MAX_ATTEMPTS,FORGE_RETRY_INITIAL_DELAY,FORGE_RETRY_MAX_DELAY, andFORGE_RETRY_BACKOFF_FACTOR, or turn them off withFORGE_RETRY_DISABLED. See Agent Retry.
operation timed out after or Command timed out after seconds
The agent-operation timeout message continues:
This may indicate:
- High system load during concurrent execution
- Network latency
- Temporary service slowness
Consider retrying or increasing timeout if this persists.
Cause: The agent or a shell step did not finish within its timeout. A timeout is different from an authentication failure. Your credentials are not the problem.
Solution:
- Check whether the agent is waiting for input or is blocked by the network.
- Run the command with
frg --tailto see where it stops. - Reduce the scope of the task, for example with
--liteor a narrower--context-dir. - Run the command again. Transient timeouts are retried automatically, as described in Transient agent failures and automatic retries.
Workflow failed in state:
Cause: A step in a stateful workflow failed. Usually the agent step failed, or an expected output is missing.
Solution:
- Read the preceding error and the trace for that state.
- Fix the cause.
- Resume from the failed step:
frg workflow run <name> --start-from <state>
IO error:
Cause: Forge cannot create or write files under .forge/work/. The project folder may be read-only, the process may lack permission, or the disk may be full.
Solution:
- Confirm that you are in the intended project root (
frg statusshowsProject Root:). - Check the permissions:
ls -ld .forge/work/
- Run Forge as a user that can write to the project folder. Ask your administrator before you change ownership or permissions recursively.
Verify: A new job folder and its traces/ folder appear under .forge/work/.