v1.1.50: shell.env Hook, Skills Path Extension, Memory Leak Fix
Release Date: February 04, 2026
One-Sentence Summary
This update adds a shell.env Hook for plugins to inject environment variables, Skills system support for reading from .agents/skills directory, fixes AbortController memory leak, and significantly improves desktop experience.
New Feature: shell.env Hook
What's Updated?
Added shell.env plugin hook, allowing custom environment variables to be injected into all shell execution contexts.
What is shell.env Hook?
This is a plugin event hook that lets you inject environment variables into AI tool calls and user terminals through plugins. For example, you can inject API Keys, project paths, etc., allowing AI to automatically access these variables when executing commands.
How to Use?
Create a plugin file in your project:
// .opencode/plugins/inject-env.js
export const InjectEnvPlugin = async () => {
return {
"shell.env": async (input, output) => {
output.env.MY_API_KEY = "secret"
output.env.PROJECT_ROOT = input.cwd
},
}
}Injected environment variables work for both AI tool execution and user terminal.
👉 Full Tutorial: Plugins Advanced
New Feature: Skills Support .agents/skills Directory
What's Updated?
The Skills system now supports reading SKILL.md files from .agents/skills directory, compatible with more Agent framework directory structures.
What's the Use?
If you use other Agent frameworks (like Claude Code), you can put Skills in .agents/skills/ directory and OpenCode will also recognize them.
Full Search Paths
| Level | Path |
|---|---|
| Project-level OpenCode Native | .opencode/skills/<name>/SKILL.md |
| Global OpenCode Native | ~/.config/opencode/skills/<name>/SKILL.md |
| Project-level Claude Compatible | .claude/skills/<name>/SKILL.md |
| Global Claude Compatible | ~/.claude/skills/<name>/SKILL.md |
| Project-level Agent Compatible | .agents/skills/<name>/SKILL.md |
| Global Agent Compatible | ~/.agents/skills/<name>/SKILL.md |
👉 Full Tutorial: Skills Basics
New Feature: Agent Custom Theme Colors
What's Updated?
You can now set theme colors when customizing Agents, making different Agents easier to distinguish in the interface.
Bug Fix: AbortController Memory Leak
Previous Issue
When using OpenCode for extended periods, AbortController closures caused memory leaks, occupying more and more memory.
Current Status
Fixed the AbortController closure memory leak issue. Memory no longer continues to grow during extended use.
Bug Fix: Plugin Repeated Installation
Previous Issue
Every time OpenCode started, plugins would be reinstalled even if already installed.
Current Status
Plugin installation status is correctly cached, no more repeated installations.
Improvement: Desktop Experience
Session Tab Restore
Previously opened session tabs are automatically restored after restarting the desktop application.
Command Palette Search
Session search functionality has been moved to the command palette for more unified operation.
Empty Prompt Submission
Desktop now allows submitting empty prompts when there are review comments.
Project Edit Icon
The edit project dialog icon now only shows on hover, making the interface cleaner.
Other Improvements
- TUI added
--thinkingflag to show reasoning process in run command - TUI clipboard automatically falls back to native clipboard after OSC52 failure
- CLI
runcommand changed to non-interactive mode - Gemini schema validation supports nested arrays and non-object types
- Cloudflare AI Gateway now uses official ai-gateway-provider package
- Excluded k2p5 model reasoning variants
- Provider config headers now correctly applied to fetch requests
Should You Upgrade?
| Situation | Recommendation |
|---|---|
| Experiencing memory leak issues | ✅ Highly Recommended |
| Using plugin system | ✅ Recommended |
| Desktop users | ✅ Recommended |
| Everything works fine | Can wait for next time |
Upgrade Command:
opencode upgradeTechnical Details (Skippable)
Click to expand full update list
Core
- Prevent memory leaks from AbortController closures (@MaxLeiter)
- Revert addition of Trinity model system prompt support
- Add Trinity model system prompt support (@mariamjabara)
- Add shell.env hook for manipulating environment in tools and shell (@tylergannon)
- Use official ai-gateway-provider package for Cloudflare AI Gateway (@elithrar)
- Allow theme colors in agent customization (@IdrisGit)
- Add support for reading skills from .agents/skills directories
- Provider headers from config not applied to fetch requests (@cloudyan)
- Ensure MCP tools are sanitized
- Add .slnx to C#/F# LSP root detection (@workedbeforepush)
- Improve skills system with better prompting, fix permission requests after skill invocation, and ensure agents can locate scripts and resources
- Exclude k2p5 from reasoning variants (@neavo)
- Handle nested array items for Gemini schema validation (@mugnimaestra)
- Plugins are always reinstalled (@neriousy)
- Strip properties and required fields from non-object types in Gemini schema (@ChickenBreast-ky)
- Make CLI run command non-interactive
TUI
- Add --thinking flag to show reasoning blocks in run command
- Always fall back to native clipboard after OSC52 (@MartinWie)
Desktop
- Faster end-to-end tests (@neriousy)
- Update command palette placeholder text
- Model selector truncating too soon
- Improve spacing in application UI
- Allow empty prompt with review comments in desktop (@dbpolito)
- Fixed terminal serialization bug in app
- Don't force mount tooltips in the app
- Restore previously opened session tabs on app restart (@ProdigyRahul)
- Edit project dialog icon now shows on hover (@ProdigyRahul)
- Move session search to command palette
- Fix custom providers overflow in app (@DNGriffin)

