Skip to content

TypeError: undefined is not an object #9118

@cogni-ai-ee

Description

@cogni-ai-ee

I've used example from https://opencode.ai/docs/github/#pull-request-example
but it didn't work:

ERROR 2026-01-17T18:56:06 +8ms service=default name=TypeError message=undefined is not an object (evaluating 'octoRest.rest') stack=TypeError: undefined is not an object (evaluating 'octoRest.rest')
    at createComment (src/cli/cmd/github.ts:1240:22)
    at createComment (src/cli/cmd/github.ts:1237:36)
    at <anonymous> (src/cli/cmd/github.ts:637:17)
    at processTicksAndRejections (native:7:39) fatal

Usage:

      - uses: anomalyco/opencode/github@latest
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          model: anthropic/claude-sonnet-4-20250514

It worked after adding:

          use_github_token: true

Should this option be added to the examples, as without it, it doesn't seems to work?

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions