oh-my-opencode 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -1,4 +1,29 @@
1
- [English](README.md) | 한국어
1
+ <!-- <CENTERED SECTION FOR GITHUB DISPLAY> -->
2
+
3
+ <div align="center">
4
+
5
+ [![Oh My OpenCode](./.github/assets/hero.jpg)](https://github.com/code-yeongyu/oh-my-opencode#oh-my-opencode)
6
+
7
+ [![Preview](./.github/assets/preview.png)](https://github.com/code-yeongyu/oh-my-opencode#oh-my-opencode)
8
+
9
+ </div>
10
+
11
+ > `oh-my-opencode` 를 설치하세요. 약 빤 것 처럼 코딩하세요. 백그라운드에 에이전트를 돌리고, oracle, librarian, frontend engineer 같은 전문 에이전트를 호출하세요. 정성스레 빚은 LSP/AST 도구, 엄선된 MCP, 완전한 Claude Code 호환 레이어를 오로지 한 줄로 누리세요.
12
+
13
+ <div align="center">
14
+
15
+ [![GitHub Release](https://img.shields.io/github/v/release/code-yeongyu/oh-my-opencode?color=369eff&labelColor=black&logo=github&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/releases)
16
+ [![GitHub Contributors](https://img.shields.io/github/contributors/code-yeongyu/oh-my-opencode?color=c4f042&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/graphs/contributors)
17
+ [![GitHub Forks](https://img.shields.io/github/forks/code-yeongyu/oh-my-opencode?color=8ae8ff&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/network/members)
18
+ [![GitHub Stars](https://img.shields.io/github/stars/code-yeongyu/oh-my-opencode?color=ffcb47&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/stargazers)
19
+ [![GitHub Issues](https://img.shields.io/github/issues/code-yeongyu/oh-my-opencode?color=ff80eb&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/issues)
20
+ [![License](https://img.shields.io/badge/license-MIT-white?labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/blob/master/LICENSE)
21
+
22
+ [English](README.md) | [한국어](README.ko.md)
23
+
24
+ </div>
25
+
26
+ <!-- </CENTERED SECTION FOR GITHUB DISPLAY> -->
2
27
 
3
28
  ## 목차
4
29
 
@@ -74,16 +99,20 @@ OpenCode 가 낭만이 사라진것같은 오늘날의 시대에, 당신에게
74
99
 
75
100
  ### 10분의 투자로 OhMyOpenCode 가 해줄 수 있는것
76
101
 
77
- 1. **백그라운드 태스크로 Gemini 3 Pro 프론트엔드를 작성하게 시켜두는 동안, Claude Opus 4.5 가 백엔드를 작성하고, 디버깅하다 막히면 GPT 5.2 에게 도움을 받습니다. 프론트엔드 구현이 완료되었다고 보고받으면, 이를 다시 확인하고 일하게 만들 수 있습니다.**
102
+ 그저 설치하면, 아래와 같은 워크플로우로 수도 있습니다.
103
+
104
+ 1. 백그라운드 태스크로 Gemini 3 Pro 가 프론트엔드를 작성하게 시켜두는 동안, Claude Opus 4.5 가 백엔드를 작성하고, 디버깅하다 막히면 GPT 5.2 에게 도움을 받습니다. 프론트엔드 구현이 완료되었다고 보고받으면, 이를 다시 확인하고 일하게 만들 수 있습니다.
78
105
  2. 뭔가 찾아볼 일이 생기면 공식문서, 내 코드베이스의 모든 히스토리, GitHub 에 공개된 현재 구현 현황까지 다 뒤져보고, 단순 Grep 을 넘어 내장된 LSP 도구, AstGrep 까지 사용하여 답변을 제공합니다.
79
106
  3. LLM 에게 일을 맡길때에 큰 컨텍스트에 대한 걱정은 더 이상 하지마세요. 제가 하겠습니다.
80
107
  - OhMyOpenCode 가 여러 에이전트를 적극 활용하도록 하여 컨텍스트 관리에 관한 부담을 줄입니다.
81
108
  - **당신의 에이전트는 이제 개발팀 리드입니다. 당신은 이제 AI Manager 입니다.**
82
109
  4. 하기로 약속 한 일을 완수 할 때 까지 멈추지 않습니다.
110
+ 5. 이 프로젝트에 자세히 알기 싫다고요? 괜찮습니다. 그냥 'ultrathink' 라고 치세요.
83
111
 
84
-
85
- - 복잡하고 일도 그냥 시키세요.
86
- - 프롬프트에서 "ultrawork" 키워드를 감지하면, 위의 모든 과정을 알아서 진행합니다.
112
+ 주의: 이걸 설치한다고 갑자기 OpenCode 가 이렇게 동작한다는 것은 아닙니다. 그저 당신의 에이전트가 훌륭한 동료와 같이, 훌륭한 도구를 갖고서 일 할 수 있도록 구성해주는것이고, 그들에게 협업하라 지시하면 협업할거에요.
113
+ 모든 과정은 당신이 완전히 컨트롤 할 수 있습니다.
114
+ ultrathink 통해 자동으로 동작하게 있지만, 그렇지 않을수도 있습니다. 이 프로젝트가 당신의 AI 에이전트 워크플로우를 제시하지는 않습니다.
115
+ 이 프로젝트는 그저 당신의 에이전트에게 좋은 동료를 소개시켜주고, 좋은 도구를 쥐어주는 것 뿐입니다.
87
116
 
88
117
  ## 설치
89
118
 
package/README.md CHANGED
@@ -1,9 +1,35 @@
1
+ <!-- <CENTERED SECTION FOR GITHUB DISPLAY> -->
2
+
3
+ <div align="center">
4
+
5
+ [![Oh My OpenCode](./.github/assets/hero.jpg)](https://github.com/code-yeongyu/oh-my-opencode#oh-my-opencode)
6
+
7
+ [![Preview](./.github/assets/preview.png)](https://github.com/code-yeongyu/oh-my-opencode#oh-my-opencode)
8
+
9
+
10
+ </div>
11
+
12
+ > This is coding on steroids—`oh-my-opencode` in action. Run background agents, call specialized agents like oracle, librarian, and frontend engineer. Use crafted LSP/AST tools, curated MCPs, and a full Claude Code compatibility layer.
13
+
14
+ <div align="center">
15
+
16
+ [![GitHub Release](https://img.shields.io/github/v/release/code-yeongyu/oh-my-opencode?color=369eff&labelColor=black&logo=github&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/releases)
17
+ [![GitHub Contributors](https://img.shields.io/github/contributors/code-yeongyu/oh-my-opencode?color=c4f042&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/graphs/contributors)
18
+ [![GitHub Forks](https://img.shields.io/github/forks/code-yeongyu/oh-my-opencode?color=8ae8ff&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/network/members)
19
+ [![GitHub Stars](https://img.shields.io/github/stars/code-yeongyu/oh-my-opencode?color=ffcb47&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/stargazers)
20
+ [![GitHub Issues](https://img.shields.io/github/issues/code-yeongyu/oh-my-opencode?color=ff80eb&labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/issues)
21
+ [![License](https://img.shields.io/badge/license-MIT-white?labelColor=black&style=flat-square)](https://github.com/code-yeongyu/oh-my-opencode/blob/master/LICENSE)
22
+
1
23
  [English](README.md) | [한국어](README.ko.md)
2
24
 
25
+ </div>
26
+
27
+ <!-- </CENTERED SECTION FOR GITHUB DISPLAY> -->
28
+
3
29
  ## Contents
4
30
 
5
31
  - [Oh My OpenCode](#oh-my-opencode)
6
- - [Skip Reading This](#skip-reading-this)
32
+ - [Just Skip Reading This Readme](#just-skip-reading-this-readme)
7
33
  - [It's the Age of Agents](#its-the-age-of-agents)
8
34
  - [10 Minutes to Unlock](#10-minutes-to-unlock)
9
35
  - [Installation](#installation)
@@ -64,7 +90,7 @@ I've fixed that.
64
90
  Even if you're not a hacker, invest a few minutes. Multiply your skills and productivity.
65
91
  Hand this doc to an agent and let them set it up.
66
92
 
67
- ## Skip Reading This
93
+ ## Just Skip Reading This Readme
68
94
 
69
95
  ### It's the Age of Agents
70
96
  - **Just paste this link into Claude Code / AmpCode / Factory Droid / Cursor and ask it to explain.**
@@ -73,13 +99,20 @@ Hand this doc to an agent and let them set it up.
73
99
 
74
100
  ### 10 Minutes to Unlock
75
101
 
76
- 1. **While Gemini 3 Pro writes the frontend as a background task, Claude Opus 4.5 handles the backend. Stuck debugging? Call GPT 5.2 for help. When the frontend reports done, verify and ship.**
102
+ Just by installing this, you make your agents to work like:
103
+
104
+ 1. While Gemini 3 Pro writes the frontend as a background task, Claude Opus 4.5 handles the backend. Stuck debugging? Call GPT 5.2 for help. When the frontend reports done, verify and ship.
77
105
  2. Need to look something up? It scours official docs, your entire codebase history, and public GitHub implementations—using not just grep but built-in LSP tools and AST-Grep.
78
106
  3. Stop worrying about context management when delegating to LLMs. I've got it covered.
79
107
  - OhMyOpenCode aggressively leverages multiple agents to lighten the context load.
80
108
  - **Your agent is now the dev team lead. You're the AI Manager.**
81
109
  4. It doesn't stop until the job is done.
110
+ 5. Don't want to dive deep into this project? No problem. Just type 'ultrathink'.
82
111
 
112
+ Note: Installing this doesn't magically make OpenCode behave this way. Above explanation is like "you can utilize even like this". It simply equips your agent with excellent teammates and powerful tools—tell them to collaborate and they will.
113
+ You're in full control.
114
+ You can enable automatic behavior via ultrathink, but you don't have to. This project doesn't dictate your AI agent workflow.
115
+ It simply introduces your agent to great colleagues and puts better tools in their hands.
83
116
 
84
117
  - Throw complex, massive tasks at it.
85
118
  - Drop the "ultrawork" keyword in your prompt and it handles everything automatically.
@@ -570,3 +603,5 @@ I have no affiliation with any project or model mentioned here. This is purely p
570
603
  - If you're on [1.0.132](https://github.com/sst/opencode/releases/tag/v1.0.132) or older, an OpenCode bug may break config.
571
604
  - [The fix](https://github.com/sst/opencode/pull/5040) was merged after 1.0.132—use a newer version.
572
605
  - Fun fact: That PR was discovered and fixed thanks to OhMyOpenCode's Librarian, Explore, and Oracle setup.
606
+
607
+ *Special thanks to @junhoyeo for this amazing hero image.*
@@ -1 +1 @@
1
- export declare const BUILD_AGENT_PROMPT_EXTENSION = "\n# Agent Orchestration & Task Management\n\nYou are not just a coder - you are an **ORCHESTRATOR**. Your primary job is to delegate work to specialized agents and track progress obsessively.\n\n## Think Before Acting\n\nWhen you receive a user request, STOP and think deeply:\n\n1. **What specialized agents can handle this better than me?**\n - explore: File search, codebase navigation, pattern matching\n - librarian: Documentation lookup, API references, implementation examples\n - oracle: Architecture decisions, code review, complex logic analysis\n - frontend-ui-ux-engineer: UI/UX implementation, component design\n - document-writer: Documentation, README, technical writing\n\n2. **Can I parallelize this work?**\n - Fire multiple background_task calls simultaneously\n - Continue working on other parts while agents investigate\n - Aggregate results when notified\n\n3. **Have I planned this in my TODO list?**\n - Break down the task into atomic steps FIRST\n - Track every investigation, every delegation\n\n## TODO Tool Obsession\n\n**USE TODO TOOLS AGGRESSIVELY.** This is non-negotiable.\n\n### When to Use TodoWrite:\n- IMMEDIATELY after receiving a user request\n- Before ANY multi-step task (even if it seems \"simple\")\n- When delegating to agents (track what you delegated)\n- After completing each step (mark it done)\n\n### TODO Workflow:\n```\nUser Request \u2192 TodoWrite (plan) \u2192 Mark in_progress \u2192 Execute/Delegate \u2192 Mark complete \u2192 Next\n```\n\n### Rules:\n- Only ONE task in_progress at a time\n- Mark complete IMMEDIATELY after finishing (never batch)\n- Never proceed without updating TODO status\n\n## Delegation Pattern\n\n```typescript\n// 1. PLAN with TODO first\ntodowrite([\n { id: \"research\", content: \"Research X implementation\", status: \"in_progress\", priority: \"high\" },\n { id: \"impl\", content: \"Implement X feature\", status: \"pending\", priority: \"high\" },\n { id: \"test\", content: \"Test X feature\", status: \"pending\", priority: \"medium\" }\n])\n\n// 2. DELEGATE research in parallel\nbackground_task(agent=\"explore\", prompt=\"Find all files related to X\")\nbackground_task(agent=\"librarian\", prompt=\"Look up X documentation\")\n\n// 3. CONTINUE working on implementation skeleton while agents research\n// 4. When notified, INTEGRATE findings and mark TODO complete\n```\n\n## Anti-Patterns (AVOID):\n- Doing everything yourself when agents can help\n- Skipping TODO planning for \"quick\" tasks\n- Forgetting to mark tasks complete\n- Sequential execution when parallel is possible\n- Direct tool calls without considering delegation\n\n## Remember:\n- You are the **team lead**, not the grunt worker\n- Your context window is precious - delegate to preserve it\n- Agents have specialized expertise - USE THEM\n- TODO tracking gives users visibility into your progress\n- Parallel execution = faster results\n";
1
+ export declare const BUILD_AGENT_PROMPT_EXTENSION = "\n# Agent Orchestration & Task Management\n\nYou are not just a coder - you are an **ORCHESTRATOR**. Your primary job is to delegate work to specialized agents and track progress obsessively.\n\n## Think Before Acting\n\nWhen you receive a user request, STOP and think deeply:\n\n1. **What specialized agents can handle this better than me?**\n - explore: File search, codebase navigation, pattern matching\n - librarian: Documentation lookup, API references, implementation examples\n - oracle: Architecture decisions, code review, complex logic analysis\n - frontend-ui-ux-engineer: UI/UX implementation, component design\n - document-writer: Documentation, README, technical writing\n\n2. **Can I parallelize this work?**\n - Fire multiple background_task calls simultaneously\n - Continue working on other parts while agents investigate\n - Aggregate results when notified\n\n3. **Have I planned this in my TODO list?**\n - Break down the task into atomic steps FIRST\n - Track every investigation, every delegation\n\n## PARALLEL TOOL CALLS - MANDATORY\n\n**ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.** This is non-negotiable.\n\nThis parallel approach allows you to:\n- Gather comprehensive context faster\n- Cross-reference information simultaneously\n- Reduce total execution time dramatically\n- Maintain high accuracy through concurrent validation\n- Complete multi-file modifications in a single turn\n\n**ALWAYS prefer parallel tool calls over sequential ones when the operations are independent.**\n\n## TODO Tool Obsession\n\n**USE TODO TOOLS AGGRESSIVELY.** This is non-negotiable.\n\n### When to Use TodoWrite:\n- IMMEDIATELY after receiving a user request\n- Before ANY multi-step task (even if it seems \"simple\")\n- When delegating to agents (track what you delegated)\n- After completing each step (mark it done)\n\n### TODO Workflow:\n```\nUser Request \u2192 TodoWrite (plan) \u2192 Mark in_progress \u2192 Execute/Delegate \u2192 Mark complete \u2192 Next\n```\n\n### Rules:\n- Only ONE task in_progress at a time\n- Mark complete IMMEDIATELY after finishing (never batch)\n- Never proceed without updating TODO status\n\n## Delegation Pattern\n\n```typescript\n// 1. PLAN with TODO first\ntodowrite([\n { id: \"research\", content: \"Research X implementation\", status: \"in_progress\", priority: \"high\" },\n { id: \"impl\", content: \"Implement X feature\", status: \"pending\", priority: \"high\" },\n { id: \"test\", content: \"Test X feature\", status: \"pending\", priority: \"medium\" }\n])\n\n// 2. DELEGATE research in parallel - FIRE MULTIPLE AT ONCE\nbackground_task(agent=\"explore\", prompt=\"Find all files related to X\")\nbackground_task(agent=\"librarian\", prompt=\"Look up X documentation\")\n\n// 3. CONTINUE working on implementation skeleton while agents research\n// 4. When notified, INTEGRATE findings and mark TODO complete\n```\n\n## Subagent Prompt Structure - MANDATORY 7 SECTIONS\n\nWhen invoking Task() or background_task() with any subagent, ALWAYS structure your prompt with these 7 sections to prevent AI slop:\n\n1. **TASK**: What exactly needs to be done (be obsessively specific)\n2. **EXPECTED OUTCOME**: Concrete deliverables when complete (files, behaviors, states)\n3. **REQUIRED SKILLS**: Which skills the agent MUST invoke\n4. **REQUIRED TOOLS**: Which tools the agent MUST use (context7 MCP, ast-grep, Grep, etc.)\n5. **MUST DO**: Exhaustive list of requirements (leave NOTHING implicit)\n6. **MUST NOT DO**: Forbidden actions (anticipate every way agent could go rogue)\n7. **CONTEXT**: Additional info agent needs (file paths, patterns, dependencies)\n\nExample:\n```\nbackground_task(agent=\"explore\", prompt=\"\"\"\nTASK: Find all authentication-related files in the codebase\n\nEXPECTED OUTCOME:\n- List of all auth files with their purposes\n- Identified patterns for token handling\n\nREQUIRED TOOLS:\n- ast-grep: Find function definitions with `sg --pattern 'def $FUNC($$$):' --lang python`\n- Grep: Search for 'auth', 'token', 'jwt' patterns\n\nMUST DO:\n- Search in src/, lib/, and utils/ directories\n- Include test files for context\n\nMUST NOT DO:\n- Do NOT modify any files\n- Do NOT make assumptions about implementation\n\nCONTEXT:\n- Project uses Python/Django\n- Auth system is custom-built\n\"\"\")\n```\n\n**Vague prompts = agent goes rogue. Lock them down.**\n\n## Anti-Patterns (AVOID):\n- Doing everything yourself when agents can help\n- Skipping TODO planning for \"quick\" tasks\n- Forgetting to mark tasks complete\n- Sequential execution when parallel is possible\n- Direct tool calls without considering delegation\n- Vague subagent prompts without the 7 sections\n\n## Remember:\n- You are the **team lead**, not the grunt worker\n- Your context window is precious - delegate to preserve it\n- Agents have specialized expertise - USE THEM\n- TODO tracking gives users visibility into your progress\n- Parallel execution = faster results\n- **ALWAYS fire multiple independent operations simultaneously**\n";
package/dist/index.js CHANGED
@@ -2852,6 +2852,19 @@ When you receive a user request, STOP and think deeply:
2852
2852
  - Break down the task into atomic steps FIRST
2853
2853
  - Track every investigation, every delegation
2854
2854
 
2855
+ ## PARALLEL TOOL CALLS - MANDATORY
2856
+
2857
+ **ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.** This is non-negotiable.
2858
+
2859
+ This parallel approach allows you to:
2860
+ - Gather comprehensive context faster
2861
+ - Cross-reference information simultaneously
2862
+ - Reduce total execution time dramatically
2863
+ - Maintain high accuracy through concurrent validation
2864
+ - Complete multi-file modifications in a single turn
2865
+
2866
+ **ALWAYS prefer parallel tool calls over sequential ones when the operations are independent.**
2867
+
2855
2868
  ## TODO Tool Obsession
2856
2869
 
2857
2870
  **USE TODO TOOLS AGGRESSIVELY.** This is non-negotiable.
@@ -2882,7 +2895,7 @@ todowrite([
2882
2895
  { id: "test", content: "Test X feature", status: "pending", priority: "medium" }
2883
2896
  ])
2884
2897
 
2885
- // 2. DELEGATE research in parallel
2898
+ // 2. DELEGATE research in parallel - FIRE MULTIPLE AT ONCE
2886
2899
  background_task(agent="explore", prompt="Find all files related to X")
2887
2900
  background_task(agent="librarian", prompt="Look up X documentation")
2888
2901
 
@@ -2890,12 +2903,54 @@ background_task(agent="librarian", prompt="Look up X documentation")
2890
2903
  // 4. When notified, INTEGRATE findings and mark TODO complete
2891
2904
  \`\`\`
2892
2905
 
2906
+ ## Subagent Prompt Structure - MANDATORY 7 SECTIONS
2907
+
2908
+ When invoking Task() or background_task() with any subagent, ALWAYS structure your prompt with these 7 sections to prevent AI slop:
2909
+
2910
+ 1. **TASK**: What exactly needs to be done (be obsessively specific)
2911
+ 2. **EXPECTED OUTCOME**: Concrete deliverables when complete (files, behaviors, states)
2912
+ 3. **REQUIRED SKILLS**: Which skills the agent MUST invoke
2913
+ 4. **REQUIRED TOOLS**: Which tools the agent MUST use (context7 MCP, ast-grep, Grep, etc.)
2914
+ 5. **MUST DO**: Exhaustive list of requirements (leave NOTHING implicit)
2915
+ 6. **MUST NOT DO**: Forbidden actions (anticipate every way agent could go rogue)
2916
+ 7. **CONTEXT**: Additional info agent needs (file paths, patterns, dependencies)
2917
+
2918
+ Example:
2919
+ \`\`\`
2920
+ background_task(agent="explore", prompt="""
2921
+ TASK: Find all authentication-related files in the codebase
2922
+
2923
+ EXPECTED OUTCOME:
2924
+ - List of all auth files with their purposes
2925
+ - Identified patterns for token handling
2926
+
2927
+ REQUIRED TOOLS:
2928
+ - ast-grep: Find function definitions with \`sg --pattern 'def $FUNC($$$):' --lang python\`
2929
+ - Grep: Search for 'auth', 'token', 'jwt' patterns
2930
+
2931
+ MUST DO:
2932
+ - Search in src/, lib/, and utils/ directories
2933
+ - Include test files for context
2934
+
2935
+ MUST NOT DO:
2936
+ - Do NOT modify any files
2937
+ - Do NOT make assumptions about implementation
2938
+
2939
+ CONTEXT:
2940
+ - Project uses Python/Django
2941
+ - Auth system is custom-built
2942
+ """)
2943
+ \`\`\`
2944
+
2945
+ **Vague prompts = agent goes rogue. Lock them down.**
2946
+
2893
2947
  ## Anti-Patterns (AVOID):
2894
2948
  - Doing everything yourself when agents can help
2895
2949
  - Skipping TODO planning for "quick" tasks
2896
2950
  - Forgetting to mark tasks complete
2897
2951
  - Sequential execution when parallel is possible
2898
2952
  - Direct tool calls without considering delegation
2953
+ - Vague subagent prompts without the 7 sections
2899
2954
 
2900
2955
  ## Remember:
2901
2956
  - You are the **team lead**, not the grunt worker
@@ -2903,6 +2958,7 @@ background_task(agent="librarian", prompt="Look up X documentation")
2903
2958
  - Agents have specialized expertise - USE THEM
2904
2959
  - TODO tracking gives users visibility into your progress
2905
2960
  - Parallel execution = faster results
2961
+ - **ALWAYS fire multiple independent operations simultaneously**
2906
2962
  `;
2907
2963
  // src/hooks/todo-continuation-enforcer.ts
2908
2964
  var CONTINUATION_PROMPT = `[SYSTEM REMINDER - TODO CONTINUATION]
@@ -8198,6 +8254,10 @@ async function attemptFetch(options) {
8198
8254
  signal: init.signal
8199
8255
  });
8200
8256
  debugLog6(`[RESP] status=${response.status} content-type=${response.headers.get("content-type") ?? ""} url=${response.url}`);
8257
+ if (response.status === 401) {
8258
+ debugLog6(`[401] Unauthorized response detected, signaling token refresh needed`);
8259
+ return "needs-refresh";
8260
+ }
8201
8261
  if (response.status === 403) {
8202
8262
  try {
8203
8263
  const text = await response.clone().text();
@@ -8347,45 +8407,99 @@ function createAntigravityFetch(getAuth, client, providerId, clientId, clientSec
8347
8407
  const sessionId = getOrCreateSessionId(fetchInstanceId);
8348
8408
  const thoughtSignature = getThoughtSignature(fetchInstanceId);
8349
8409
  debugLog6(`[TSIG][GET] sessionId=${sessionId}, signature=${thoughtSignature ? thoughtSignature.substring(0, 20) + "..." : "none"}`);
8350
- for (let i = 0;i < maxEndpoints; i++) {
8351
- const endpoint = ANTIGRAVITY_ENDPOINT_FALLBACKS[i];
8352
- const response = await attemptFetch({
8353
- endpoint,
8354
- url,
8355
- init,
8356
- accessToken: cachedTokens.access_token,
8357
- projectId,
8358
- sessionId,
8359
- modelName,
8360
- thoughtSignature
8410
+ let hasRefreshedFor401 = false;
8411
+ const executeWithEndpoints = async () => {
8412
+ for (let i = 0;i < maxEndpoints; i++) {
8413
+ const endpoint = ANTIGRAVITY_ENDPOINT_FALLBACKS[i];
8414
+ const response = await attemptFetch({
8415
+ endpoint,
8416
+ url,
8417
+ init,
8418
+ accessToken: cachedTokens.access_token,
8419
+ projectId,
8420
+ sessionId,
8421
+ modelName,
8422
+ thoughtSignature
8423
+ });
8424
+ if (response === "pass-through") {
8425
+ debugLog6("Non-string body detected, passing through with auth headers");
8426
+ const headersWithAuth = {
8427
+ ...init.headers,
8428
+ Authorization: `Bearer ${cachedTokens.access_token}`
8429
+ };
8430
+ return fetch(url, { ...init, headers: headersWithAuth });
8431
+ }
8432
+ if (response === "needs-refresh") {
8433
+ if (hasRefreshedFor401) {
8434
+ debugLog6("[401] Already refreshed once, returning unauthorized error");
8435
+ return new Response(JSON.stringify({
8436
+ error: {
8437
+ message: "Authentication failed after token refresh",
8438
+ type: "unauthorized",
8439
+ code: "token_refresh_failed"
8440
+ }
8441
+ }), {
8442
+ status: 401,
8443
+ statusText: "Unauthorized",
8444
+ headers: { "Content-Type": "application/json" }
8445
+ });
8446
+ }
8447
+ debugLog6("[401] Refreshing token and retrying...");
8448
+ hasRefreshedFor401 = true;
8449
+ try {
8450
+ const newTokens = await refreshAccessToken(refreshParts.refreshToken, clientId, clientSecret);
8451
+ cachedTokens = {
8452
+ type: "antigravity",
8453
+ access_token: newTokens.access_token,
8454
+ refresh_token: newTokens.refresh_token,
8455
+ expires_in: newTokens.expires_in,
8456
+ timestamp: Date.now()
8457
+ };
8458
+ clearProjectContextCache();
8459
+ const formattedRefresh = formatTokenForStorage(newTokens.refresh_token, refreshParts.projectId || "", refreshParts.managedProjectId);
8460
+ await client.set(providerId, {
8461
+ access: newTokens.access_token,
8462
+ refresh: formattedRefresh,
8463
+ expires: Date.now() + newTokens.expires_in * 1000
8464
+ });
8465
+ debugLog6("[401] Token refreshed, retrying request...");
8466
+ return executeWithEndpoints();
8467
+ } catch (refreshError) {
8468
+ debugLog6(`[401] Token refresh failed: ${refreshError instanceof Error ? refreshError.message : "Unknown error"}`);
8469
+ return new Response(JSON.stringify({
8470
+ error: {
8471
+ message: `Token refresh failed: ${refreshError instanceof Error ? refreshError.message : "Unknown error"}`,
8472
+ type: "unauthorized",
8473
+ code: "token_refresh_failed"
8474
+ }
8475
+ }), {
8476
+ status: 401,
8477
+ statusText: "Unauthorized",
8478
+ headers: { "Content-Type": "application/json" }
8479
+ });
8480
+ }
8481
+ }
8482
+ if (response) {
8483
+ debugLog6(`Success with endpoint: ${endpoint}`);
8484
+ const transformedResponse = await transformResponseWithThinking(response, modelName || "", fetchInstanceId);
8485
+ return transformedResponse;
8486
+ }
8487
+ }
8488
+ const errorMessage = `All Antigravity endpoints failed after ${maxEndpoints} attempts`;
8489
+ debugLog6(errorMessage);
8490
+ return new Response(JSON.stringify({
8491
+ error: {
8492
+ message: errorMessage,
8493
+ type: "endpoint_failure",
8494
+ code: "all_endpoints_failed"
8495
+ }
8496
+ }), {
8497
+ status: 503,
8498
+ statusText: "Service Unavailable",
8499
+ headers: { "Content-Type": "application/json" }
8361
8500
  });
8362
- if (response === "pass-through") {
8363
- debugLog6("Non-string body detected, passing through with auth headers");
8364
- const headersWithAuth = {
8365
- ...init.headers,
8366
- Authorization: `Bearer ${cachedTokens.access_token}`
8367
- };
8368
- return fetch(url, { ...init, headers: headersWithAuth });
8369
- }
8370
- if (response) {
8371
- debugLog6(`Success with endpoint: ${endpoint}`);
8372
- const transformedResponse = await transformResponseWithThinking(response, modelName || "", fetchInstanceId);
8373
- return transformedResponse;
8374
- }
8375
- }
8376
- const errorMessage = `All Antigravity endpoints failed after ${maxEndpoints} attempts`;
8377
- debugLog6(errorMessage);
8378
- return new Response(JSON.stringify({
8379
- error: {
8380
- message: errorMessage,
8381
- type: "endpoint_failure",
8382
- code: "all_endpoints_failed"
8383
- }
8384
- }), {
8385
- status: 503,
8386
- statusText: "Service Unavailable",
8387
- headers: { "Content-Type": "application/json" }
8388
- });
8501
+ };
8502
+ return executeWithEndpoints();
8389
8503
  };
8390
8504
  }
8391
8505
  // src/auth/antigravity/plugin.ts
@@ -25147,13 +25261,15 @@ var OhMyOpenCodePlugin = async (ctx) => {
25147
25261
  ...projectAgents,
25148
25262
  ...config3.agent
25149
25263
  };
25150
- if (config3.agent.build) {
25151
- const existingPrompt = config3.agent.build.prompt || "";
25152
- const userOverride = pluginConfig.agents?.build?.prompt || "";
25153
- config3.agent.build = {
25154
- ...config3.agent.build,
25155
- prompt: existingPrompt + BUILD_AGENT_PROMPT_EXTENSION + userOverride
25156
- };
25264
+ for (const [agentName, agentConfig] of Object.entries(config3.agent ?? {})) {
25265
+ if (agentConfig && agentConfig.mode !== "subagent") {
25266
+ const existingPrompt = agentConfig.prompt || "";
25267
+ const userOverride = pluginConfig.agents?.[agentName]?.prompt || "";
25268
+ config3.agent[agentName] = {
25269
+ ...agentConfig,
25270
+ prompt: existingPrompt + BUILD_AGENT_PROMPT_EXTENSION + userOverride
25271
+ };
25272
+ }
25157
25273
  }
25158
25274
  config3.tools = {
25159
25275
  ...config3.tools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",