Feat: show info on loaded instructions in tool metadata info#2
Open
webbugt wants to merge 6 commits intoekroon:mainfrom
Open
Feat: show info on loaded instructions in tool metadata info#2webbugt wants to merge 6 commits intoekroon:mainfrom
webbugt wants to merge 6 commits intoekroon:mainfrom
Conversation
Replace tool title modification (not rendered by TUI for built-in tools) with a summary entry appended to metadata.loaded array. The summary includes both repo-wide and path-specific instructions in the total count. Also upgrades @opencode-ai/plugin and @opencode-ai/sdk to v1.1.65, fixing breaking type changes (model required on system.transform, args required on tool.execute.after).
There was a problem hiding this comment.
Pull request overview
This PR adds visibility into which instruction files are loaded by displaying them in tool metadata. When path-specific instructions are injected during file operations (read, edit, write), the plugin now populates the metadata.loaded array with the paths of loaded instruction files and a summary count.
Changes:
- Modified
SessionStateto track both instruction text and loaded file paths for each pending tool call - Updated
tool.execute.afterhook to populateoutput.metadata.loadedwith instruction file paths and a total count summary - Upgraded
@opencode-ai/pluginand@opencode-ai/sdkdependencies from1.1.3to1.1.65
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/session-state.ts | Changed pending instructions data structure from Map<string, string> to Map<string, { text: string; loadedFiles: string[] }> to track loaded file paths alongside instruction text |
| src/session-state.test.ts | Added comprehensive tests for the new loadedFiles tracking in pending instructions |
| src/integration.test.ts | Added tui.showToast mock to support updated SDK requirements |
| src/index.ts | Modified tool.execute.after to populate metadata.loaded with instruction file paths and summary count; added empty line for formatting |
| src/index.test.ts | Added extensive test coverage for metadata population, including singular/plural counts, preservation of existing entries, and repo-wide instruction counting; added model property to test inputs for SDK compatibility |
| package.json | Updated SDK dependencies to version 1.1.65 |
| package-lock.json | Updated lock file with new dependency versions and removed peer: true markers |
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Author
|
@ekroon Hello, any chance this get's merged/reviewed? :3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello, love the plugin. I consider the scoped instructions the Copilot way far superior to the regular AGENTS.md, or other global instruction systems, especially in monorepo setups.
Tldr: Add additional info on which instructions were loaded: