Problem
The OpenCode (OC) agent in GitHub Actions sometimes fails to respond to /oc comments entirely, and sometimes enters loops when asked to create issues. This was observed consistently in PR #224.
Symptoms:
- Some
/oc commands produce no response at all (no eyes emoji, no workflow run)
- Quote-reply comments with
/oc after > blocks appear to not trigger the workflow
- When triggered, the agent sometimes asks for confirmation instead of acting on explicit instructions
- Git auth failures on the runner (
Author identity unknown, could not read Username) suggest permission/scope issues
Observed in PR #224
| Comment |
Result |
/oc address coderabitai's recent unresolved comments and resolve |
Ran but failed — Author identity unknown (no git config) |
/oc try again (quote-reply) |
Ran but failed — fatal: could not read Username for 'https://github.com' |
/oc in your latest commit you didnt follow git conventions... |
Ran and responded with investigation/plan |
/oc make an issue with your ideas so far, we will continue planning there |
Ran but asked for confirmation instead of creating the issue |
/oc why didnt my previous latest comment mentioning you trigger a run from you? |
Ran and explained it did trigger, responded with analysis instead of action |
/oc maybe it ran so quick i didnt see the eyes emoji... |
Ran but still didn't create the issue |
Key failure case: The user's initial quote-reply commands (steps 1–2) produced no visible trigger, leading to confusion about whether OC was working at all.
Likely Root Causes
1. Workflow trigger doesn't handle quote-reply formatting
The current condition:
contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc')
Fails for comments where /oc appears after markdown quote blocks (>), since the body starts with > not /oc, and /oc may not match depending on whitespace in the quoted text.
2. Insufficient runner permissions
Only id-token: write is granted. Git operations (push, commit) require contents: write and authenticated credentials (GITHUB_TOKEN or a PAT). The Author identity unknown and Username prompt errors confirm this.
3. Agent behaviour — confirmation loop
When asked to create an issue, the agent asked for confirmation instead of executing immediately, suggesting the system prompt or tool configuration may not be tuned for autonomous action on explicit user instructions.
Proposed Solution
- Fix the trigger regex — Account for quote-reply blocks, leading whitespace, and inline
/oc commands anywhere in the comment body
- Grant necessary permissions — Add
contents: write to the workflow permissions and ensure GITHUB_TOKEN is passed and git identity is configured on the runner
- Tune agent autonomy — Adjust the system prompt so that explicit
/oc commands like "make an issue" execute immediately without confirmation loops
Commit type note
This is a CI/tooling improvement. Commits for this issue must use chore: or ci: prefix — not fix: or feat: — to avoid triggering an auto-release via semantic-release on main. The conventionalcommits preset maps fix: → patch bump and feat: → minor bump; only chore:/ci:/docs:/refactor: produce no version bump.
Acceptance Criteria
Problem
The OpenCode (OC) agent in GitHub Actions sometimes fails to respond to
/occomments entirely, and sometimes enters loops when asked to create issues. This was observed consistently in PR #224.Symptoms:
/occommands produce no response at all (no eyes emoji, no workflow run)/ocafter>blocks appear to not trigger the workflowAuthor identity unknown,could not read Username) suggest permission/scope issuesObserved in PR #224
/oc address coderabitai's recent unresolved comments and resolveAuthor identity unknown(no git config)/oc try again(quote-reply)fatal: could not read Username for 'https://github.com'/oc in your latest commit you didnt follow git conventions.../oc make an issue with your ideas so far, we will continue planning there/oc why didnt my previous latest comment mentioning you trigger a run from you?/oc maybe it ran so quick i didnt see the eyes emoji...Key failure case: The user's initial quote-reply commands (steps 1–2) produced no visible trigger, leading to confusion about whether OC was working at all.
Likely Root Causes
1. Workflow trigger doesn't handle quote-reply formatting
The current condition:
contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc')Fails for comments where
/ocappears after markdown quote blocks (>), since the body starts with>not/oc, and/ocmay not match depending on whitespace in the quoted text.2. Insufficient runner permissions
Only
id-token: writeis granted. Git operations (push, commit) requirecontents: writeand authenticated credentials (GITHUB_TOKENor a PAT). TheAuthor identity unknownand Username prompt errors confirm this.3. Agent behaviour — confirmation loop
When asked to create an issue, the agent asked for confirmation instead of executing immediately, suggesting the system prompt or tool configuration may not be tuned for autonomous action on explicit user instructions.
Proposed Solution
/occommands anywhere in the comment bodycontents: writeto the workflow permissions and ensureGITHUB_TOKENis passed and git identity is configured on the runner/occommands like "make an issue" execute immediately without confirmation loopsCommit type note
This is a CI/tooling improvement. Commits for this issue must use
chore:orci:prefix — notfix:orfeat:— to avoid triggering an auto-release via semantic-release onmain. Theconventionalcommitspreset mapsfix:→ patch bump andfeat:→ minor bump; onlychore:/ci:/docs:/refactor:produce no version bump.Acceptance Criteria
/occommands inside quote-reply blocks (> /oc ...) trigger the workflow/occommand format