Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

feat: configure context paths - #86

Merged
kujtimiihoxha merged 14 commits into
opencode-ai:mainfrom
garrettladley:feat/configure-context-files
Apr 27, 2025
Merged

kujtimiihoxha merged 14 commits into
opencode-ai:mainfrom
garrettladley:feat/configure-context-files

Conversation

@garrettladley

@garrettladley garrettladley commented Apr 27, 2025 •

Copy link
Copy Markdown
Contributor

implements the feature requested by #59

  • port the defaults to the config
  • generate opencode json schema
  • better context paths traversal

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@garrettladley thanks for the PR, is it OK if I merge this one in first #69 and than you can rebase and add support for directories?

@garrettladley

Copy link
Copy Markdown
Contributor Author

sounds like a plan @kujtimiihoxha

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@garrettladley merged it in, also I am wondering if we should add some message above the file context to tell the LLM that the following is instructions/context provided by the user and it should follow rules and instructions or something like that, that might fix #90. Basically something to tell the LLM that it is important to follow these rules and instructions

@garrettladley

Copy link
Copy Markdown
Contributor Author

@kujtimiihoxha updated and cleaned up the processing code

@garrettladley garrettladley changed the title feat: configure context files feat: configure context paths Apr 27, 2025
Comment thread internal/llm/prompt/prompt.go Resolved
@garrettladley

Copy link
Copy Markdown
Contributor Author

updated 😀

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@garrettladley for some reason I am seeing This branch cannot be rebased due to conflicts maybe you can rebase this ?
Screenshot 2025-04-27 at 19 40 59

AvicennaJr and others added 9 commits April 27, 2025 14:03
Added nil check in GetPersistentShell before accessing
shellInstance.isAlive
to prevent panic when newPersistentShell returns nil due to shell
startup
errors. This resolves the "invalid memory address or nil pointer
dereference"
error that was occurring in the shell tool.
…formance

- Introduced `globWithRipgrep` function to perform file globbing using the `rg` (ripgrep) command.
- Updated `globFiles` to prioritize ripgrep-based globbing and fall back to doublestar-based globbing if ripgrep fails.
- Added logic to handle ripgrep command execution, output parsing, and filtering of hidden files.
- Ensured results are sorted by path length and limited to the specified maximum number of matches.
- Modified imports to include `os/exec` and `bytes` for ripgrep integration.
@garrettladley
garrettladley force-pushed the feat/configure-context-files branch from 3193c48 to 14f627c Compare April 27, 2025 18:05
@garrettladley

Copy link
Copy Markdown
Contributor Author

@kujtimiihoxha how about now?

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@garrettladley Thanks for the PR. Something weird is going on with the commits but I just squash and merge 🤷

@possibilities

possibilities commented Apr 27, 2025 •

Copy link
Copy Markdown

With this commit opencode exits without showing the TUI. Only when there is a ./OpenCode.md present.

▶ ~/src/opencode/opencode

▶ echo $?
0

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

uff ok checking

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@possibilities fix pushed

@possibilities

Copy link
Copy Markdown

Thanks, confirmed

@kujtimiihoxha

Copy link
Copy Markdown
Contributor

@possibilities I also just pushed a change that prevents duplicate context entries on macos OpenCode.md OPENCODE.md and any variant will be treated the same because of case insensitive paths, the change now prevents it to be added multiple times

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants