GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(cli): document run --format json records, exit codes and permissions by oldantique · Pull Request #60543 · anomalyco/opencode

Conversation

@oldantique

@oldantique oldantique commented Oct 30, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Related: #53207

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The run docs say --format json emits NDJSON but not what the records contain, so script authors end up reading noninteractive.ts. This adds short sections on the JSON records, exit codes, and how run handles permission requests.

How did you verify your code works?

Checked each statement against noninteractive.ts and the run flags on current dev (including #60475), and the record shapes, the provider.no-route error and the permission behavior against real runs on 2.0.26. astro check, bun run build and prettier pass.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #50062, #60278

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@oldantique
docs(cli): document run --format json records, exit codes and permiss…
cae9f14
…ions
Copilot AI balanced review requested due to automatic review settings October 30, 2026 09:06
Copilot AI reviewed Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Oct 30, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs match the current run implementation, apart from one small exit-code case. I checked the record envelope, each record type and its fields (reasoning only with --thinking, tool_use only once a call succeeds or fails, step_finish reasons matching FinishReason), stderr for warnings, exit codes 0/1/130, the provider.no-route error and the permission behaviour against packages/cli/src/run/noninteractive.ts and run.ts. They all line up.

Public API is unchanged; this is documentation only.

One small gap on the exit-code table: see the inline comment. Also note that #60508 (open) would change when a recovered step emits error and exits 1, so these tables may need a touch-up if that lands.

Related: #50062, #60278

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread services/www/src/docs/content/cli/commands.mdx Outdated
| Code | Meaning |
| ----- | ----------------------------------------------------------------- |
| `0` | The run completed. Individual tool calls may still have failed. |
| `1` | The run failed. With `--format json`, an `error` record says why. |

@opencodejr opencodejr Bot Oct 30, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite always true: when a non-question form (e.g. an MCP elicitation) is cancelled, cancelForm in noninteractive.ts sets process.exitCode = 1 without emitting an error record, so a script can see exit 1 with no error line. Maybe soften this to "usually", or mention that runs needing input they can't get (other than questions) also exit 1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@oldantique oldantique Nov 3, 2026

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, changed to "usually" (75a2478).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@oldantique
docs(cli): exit 1 does not always carry an error record
75a2478
opencodejr[bot]
opencodejr Bot reviewed Nov 3, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit addresses the earlier point: the exit-code table now says an error record usually explains exit 1, which matches the non-question form cancellation case. I have nothing further. Public API is unchanged; this is documentation only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot mentioned this pull request Nov 3, 2026
📊 AI CLI 工具社区动态日报 2026-11-03 litang9/big_model_radar#645
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@oldantique
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.