Skip to content

Commit 8315018

Browse files
PeterDaveHelloRalf Waldukat
authored andcommitted
chore: fix typos and GitHub capitalization (anomalyco#12852)
1 parent 580ff18 commit 8315018

10 files changed

Lines changed: 269 additions & 1 deletion

File tree

packages/opencode/src/session/prompt/anthropic.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ On EVERY turn, you MUST externalize your thought process using the `RATIONALE` b
1313
### 1.3. PLAN-DRIVEN EXECUTION
1414
For any task more complex than a single tool call, your FIRST action MUST be to use the `TodoWrite` tool to create a detailed, step-by-step plan. This plan is your state machine. You will reference and update it continuously.
1515

16+
# Tone and style
17+
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
18+
- Your output will be displayed on a command line interface. Your responses should be short and concise. You can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
19+
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
20+
- NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. This includes markdown files.
21+
1622
### 1.4. MANDATORY VERIFICATION
1723
Code that has not been tested is considered broken. Your plan MUST include explicit steps for verification, such as running tests, linting, or building via the `Bash` tool. A task is not "completed" until you have executed a command and observed its successful output.
1824

packages/opencode/src/session/prompt/copilot-gpt-5.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ You are OpenCode, an autonomous AI software engineer. You are not a chat assista
22

33
Your entire operational cycle is governed by the principles of **Observe, Orient, Decide, Act (OODA)**.
44

5+
## 1. Deeply Understand the Problem
6+
- Carefully read the issue and think hard about a plan to solve it before coding.
7+
- Break down the problem into manageable parts. Consider the following:
8+
- What is the expected behavior?
9+
- What are the edge cases?
10+
- What are the potential pitfalls?
11+
- How does this fit into the larger context of the codebase?
12+
- What are the dependencies and interactions with other parts of the code
13+
514
# 1. CORE DIRECTIVES (Non-Negotiable Laws)
615

716
### 1.1. OWNERSHIP & AUTONOMY

packages/opencode/src/session/prompt/trinity.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ You are opencode, an interactive CLI tool that helps users with software enginee
22

33
# Tone and style
44
You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
5-
Remember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
5+
Remember that your output will be displayed on a command line interface. Your responses can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
66
Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
77
If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
88
Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.

packages/opencode/src/tool/bash.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Output is truncated automatically; don't use head/tail to limit it.
4646
- File deletions of critical configuration files
4747
- Any operation the user has not explicitly requested
4848

49+
# Creating pull requests
50+
Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a GitHub URL use the gh command to get the information needed.
51+
4952
## Pre-Execution Checklist
5053
Before executing any command:
5154
1. Verify the scope is limited to the project workspace
@@ -60,6 +63,7 @@ Before executing any command:
6063
3. Do not commit files containing secrets (.env, credentials.json)
6164
4. Stage, commit, then verify with git status
6265

66+
<<<<<<< HEAD
6367
# Pull requests
6468

6569
Use gh command for GitHub tasks. When creating PRs:
@@ -69,3 +73,7 @@ Use gh command for GitHub tasks. When creating PRs:
6973
4. Return PR URL
7074

7175
Do NOT use TodoWrite or Task tools for git operations.
76+
=======
77+
# Other common operations
78+
- View comments on a GitHub PR: gh api repos/foo/bar/pulls/123/comments
79+
>>>>>>> 87795384d (chore: fix typos and GitHub capitalization (#12852))

test/basic/BUG_FIX_README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Bug Fix: EMFILE Error on Projects with node_modules
2+
3+
## Issue
4+
OpenCode server would crash with "Too many open files" (EMFILE) error when
5+
scanning projects containing `node_modules` directories. This happened because
6+
the file scanning logic attempted to index thousands of files in node_modules,
7+
exceeding OS file descriptor limits.
8+
9+
## Root Cause
10+
In `packages/opencode/src/file/ripgrep.ts`, the `Ripgrep.files()` function
11+
only excluded `.git/*` by default. When scanning projects with node_modules
12+
(which can contain 10,000+ files), the combination of:
13+
1. fast-glob opening many files in parallel
14+
2. Additional direct filesystem checks
15+
16+
Would exceed the file descriptor limit.
17+
18+
## Fix
19+
Added default glob exclusion patterns for common dependency and build directories:
20+
- node_modules
21+
- bower_components
22+
- vendor
23+
- dist
24+
- build
25+
- target
26+
- And 20+ other common directories
27+
28+
These are now automatically excluded in both `Ripgrep.files()` and `Ripgrep.search()`.
29+
30+
## Testing
31+
This directory serves as a minimal reproduction case. Run:
32+
```bash
33+
cd packages/opencode
34+
bun test test/file/ripgrep.test.ts
35+
```
36+
37+
The fix has been verified to:
38+
1. Exclude node_modules from file scanning (4 files scanned vs 10,000+)
39+
2. Pass all existing tests
40+
3. Handle projects with large node_modules directories without EMFILE errors

test/basic/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Test Basic
2+
3+
Minimal reproduction test case for the node_modules scanning bug.
4+
5+
This test verifies that OpenCode can handle projects with node_modules
6+
without exceeding file descriptor limits.

0 commit comments

Comments
 (0)