Skip to content

Commit 84dea26

Browse files
committed
Merge upstream/dev while preserving preemptive compaction
- Merged latest upstream changes from code-yeongyu/oh-my-opencode - Restored preemptive compaction hooks removed in upstream - Added preemptive_compaction and preemptive_compaction_threshold to schema - Re-registered preemptive compaction hook in index.ts
2 parents b3e07b2 + e23ce11 commit 84dea26

File tree

115 files changed

+4031
-1042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4031
-1042
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [master, dev]
66
pull_request:
7-
branches: [master]
7+
branches: [dev]
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
- uses: actions/setup-node@v4
7878
with:
7979
node-version: "24"
80+
registry-url: "https://registry.npmjs.org"
8081

8182
- name: Upgrade npm for OIDC trusted publishing
8283
run: npm install -g npm@latest
@@ -109,9 +110,12 @@ jobs:
109110
echo "=== Running bun build (CLI) ==="
110111
bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi
111112
echo "=== Running tsc ==="
112-
tsc --emitDeclarationOnly
113+
bunx tsc --emitDeclarationOnly
113114
echo "=== Running build:schema ==="
114115
bun run build:schema
116+
117+
- name: Build platform binaries
118+
run: bun run build:binaries
115119

116120
- name: Verify build output
117121
run: |
@@ -121,6 +125,13 @@ jobs:
121125
ls -la dist/cli/
122126
test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1)
123127
test -f dist/cli/index.js || (echo "ERROR: dist/cli/index.js not found!" && exit 1)
128+
echo "=== Platform binaries ==="
129+
for platform in darwin-arm64 darwin-x64 linux-x64 linux-arm64 linux-x64-musl linux-arm64-musl; do
130+
test -f "packages/${platform}/bin/oh-my-opencode" || (echo "ERROR: packages/${platform}/bin/oh-my-opencode not found!" && exit 1)
131+
echo "✓ packages/${platform}/bin/oh-my-opencode"
132+
done
133+
test -f "packages/windows-x64/bin/oh-my-opencode.exe" || (echo "ERROR: packages/windows-x64/bin/oh-my-opencode.exe not found!" && exit 1)
134+
echo "✓ packages/windows-x64/bin/oh-my-opencode.exe"
124135
125136
- name: Publish
126137
run: bun run script/publish.ts
@@ -130,6 +141,7 @@ jobs:
130141
CI: true
131142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132143
NPM_CONFIG_PROVENANCE: true
144+
SKIP_PLATFORM_PACKAGES: true
133145

134146
- name: Delete draft release
135147
run: gh release delete next --yes 2>/dev/null || echo "No draft release to delete"

.github/workflows/sisyphus-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
opencode --version
104104
105105
# Run local oh-my-opencode install (uses built dist)
106-
bun run dist/cli/index.js install --no-tui --claude=max20 --chatgpt=no --gemini=no
106+
bun run dist/cli/index.js install --no-tui --claude=max20 --chatgpt=no --gemini=no --copilot=no
107107
108108
# Override plugin to use local file reference
109109
OPENCODE_JSON=~/.config/opencode/opencode.json

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ node_modules/
55
# Build output
66
dist/
77

8+
# Platform binaries (built, not committed)
9+
packages/*/bin/oh-my-opencode
10+
packages/*/bin/oh-my-opencode.exe
11+
812
# IDE
913
.idea/
1014
.vscode/

AGENTS.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PROJECT KNOWLEDGE BASE
22

3-
**Generated:** 2026-01-13T14:45:00+09:00
4-
**Commit:** e47b5514
3+
**Generated:** 2026-01-15T14:53:00+09:00
4+
**Commit:** 89fa9ff1
55
**Branch:** dev
66

77
## OVERVIEW
@@ -13,16 +13,15 @@ OpenCode plugin implementing Claude Code/AmpCode features. Multi-model agent orc
1313
```
1414
oh-my-opencode/
1515
├── src/
16-
│ ├── agents/ # AI agents (7+): Sisyphus, oracle, librarian, explore, frontend, document-writer, multimodal-looker, prometheus, metis, momus
16+
│ ├── agents/ # AI agents (10+): Sisyphus, oracle, librarian, explore, frontend, document-writer, multimodal-looker, prometheus, metis, momus
1717
│ ├── hooks/ # 22+ lifecycle hooks - see src/hooks/AGENTS.md
1818
│ ├── tools/ # LSP, AST-Grep, Grep, Glob, session mgmt - see src/tools/AGENTS.md
1919
│ ├── features/ # Claude Code compat layer - see src/features/AGENTS.md
20-
│ ├── auth/ # Google Antigravity OAuth - see src/auth/AGENTS.md
2120
│ ├── shared/ # Cross-cutting utilities - see src/shared/AGENTS.md
2221
│ ├── cli/ # CLI installer, doctor - see src/cli/AGENTS.md
2322
│ ├── mcp/ # MCP configs: context7, grep_app, websearch
24-
│ ├── config/ # Zod schema (12k lines), TypeScript types
25-
│ └── index.ts # Main plugin entry (563 lines)
23+
│ ├── config/ # Zod schema, TypeScript types
24+
│ └── index.ts # Main plugin entry (580 lines)
2625
├── script/ # build-schema.ts, publish.ts, generate-changelog.ts
2726
├── assets/ # JSON schema
2827
└── dist/ # Build output (ESM + .d.ts)
@@ -39,7 +38,6 @@ oh-my-opencode/
3938
| Add skill | `src/features/builtin-skills/` | Create skill dir with SKILL.md |
4039
| LSP behavior | `src/tools/lsp/` | client.ts (connection), tools.ts (handlers) |
4140
| AST-Grep | `src/tools/ast-grep/` | napi.ts for @ast-grep/napi binding |
42-
| Google OAuth | `src/auth/antigravity/` | OAuth plugin for Google/Gemini models |
4341
| Config schema | `src/config/schema.ts` | Zod schema, run `bun run build:schema` after changes |
4442
| Claude Code compat | `src/features/claude-code-*-loader/` | Command, skill, agent, mcp loaders |
4543
| Background agents | `src/features/background-agent/` | manager.ts for task management |
@@ -50,7 +48,7 @@ oh-my-opencode/
5048
| Shared utilities | `src/shared/` | Cross-cutting utilities |
5149
| Slash commands | `src/hooks/auto-slash-command/` | Auto-detect and execute `/command` patterns |
5250
| Ralph Loop | `src/hooks/ralph-loop/` | Self-referential dev loop until completion |
53-
| Orchestrator | `src/hooks/sisyphus-orchestrator/` | Main orchestration hook (677 lines) |
51+
| Orchestrator | `src/hooks/sisyphus-orchestrator/` | Main orchestration hook (684 lines) |
5452

5553
## TDD (Test-Driven Development)
5654

@@ -83,7 +81,7 @@ oh-my-opencode/
8381
- **Build**: `bun build` (ESM) + `tsc --emitDeclarationOnly`
8482
- **Exports**: Barrel pattern in index.ts; explicit named exports for tools/hooks
8583
- **Naming**: kebab-case directories, createXXXHook/createXXXTool factories
86-
- **Testing**: BDD comments `#given/#when/#then`, TDD workflow (RED-GREEN-REFACTOR), 82 test files
84+
- **Testing**: BDD comments `#given/#when/#then`, TDD workflow (RED-GREEN-REFACTOR), 80+ test files
8785
- **Temperature**: 0.1 for code agents, max 0.3
8886

8987
## ANTI-PATTERNS (THIS PROJECT)
@@ -140,7 +138,7 @@ bun run typecheck # Type check
140138
bun run build # ESM + declarations + schema
141139
bun run rebuild # Clean + Build
142140
bun run build:schema # Schema only
143-
bun test # Run tests (82 test files, 2559+ BDD assertions)
141+
bun test # Run tests (80+ test files, 2500+ BDD assertions)
144142
```
145143

146144
## DEPLOYMENT
@@ -157,26 +155,23 @@ bun test # Run tests (82 test files, 2559+ BDD assertions)
157155

158156
- **ci.yml**: Parallel test/typecheck, build verification, auto-commit schema on master, rolling `next` draft release
159157
- **publish.yml**: Manual workflow_dispatch, version bump, changelog, OIDC npm publish
160-
- **sisyphus-agent.yml**: Agent-in-CI for automated issue handling via `@sisyphus-dev-ai` mentions
161158

162159
## COMPLEXITY HOTSPOTS
163160

164161
| File | Lines | Description |
165162
|------|-------|-------------|
166-
| `src/agents/orchestrator-sisyphus.ts` | 1486 | Orchestrator agent, 7-section delegation, accumulated wisdom |
163+
| `src/agents/orchestrator-sisyphus.ts` | 1485 | Orchestrator agent, 7-section delegation, accumulated wisdom |
167164
| `src/features/builtin-skills/skills.ts` | 1230 | Skill definitions (frontend-ui-ux, playwright) |
168-
| `src/agents/prometheus-prompt.ts` | 988 | Planning agent, interview mode, multi-agent validation |
169-
| `src/auth/antigravity/fetch.ts` | 798 | Token refresh, multi-account rotation, endpoint fallback |
170-
| `src/auth/antigravity/thinking.ts` | 755 | Thinking block extraction, signature management |
171-
| `src/cli/config-manager.ts` | 725 | JSONC parsing, multi-level config, env detection |
172-
| `src/hooks/sisyphus-orchestrator/index.ts` | 677 | Orchestrator hook impl |
165+
| `src/agents/prometheus-prompt.ts` | 991 | Planning agent, interview mode, multi-agent validation |
166+
| `src/features/background-agent/manager.ts` | 928 | Task lifecycle, concurrency |
167+
| `src/cli/config-manager.ts` | 730 | JSONC parsing, multi-level config, env detection |
168+
| `src/hooks/sisyphus-orchestrator/index.ts` | 684 | Orchestrator hook impl |
169+
| `src/tools/sisyphus-task/tools.ts` | 667 | Category-based task delegation |
173170
| `src/agents/sisyphus.ts` | 643 | Main Sisyphus prompt |
174171
| `src/tools/lsp/client.ts` | 632 | LSP protocol, JSON-RPC |
175-
| `src/features/background-agent/manager.ts` | 825 | Task lifecycle, concurrency |
176-
| `src/auth/antigravity/response.ts` | 598 | Response transformation, streaming |
177-
| `src/tools/sisyphus-task/tools.ts` | 583 | Category-based task delegation |
178-
| `src/index.ts` | 563 | Main plugin, all hook/tool init |
179-
| `src/hooks/anthropic-context-window-limit-recovery/executor.ts` | 555 | Multi-stage recovery |
172+
| `src/features/builtin-commands/templates/refactor.ts` | 619 | Refactoring command template |
173+
| `src/index.ts` | 580 | Main plugin, all hook/tool init |
174+
| `src/hooks/anthropic-context-window-limit-recovery/executor.ts` | 554 | Multi-stage recovery |
180175

181176
## MCP ARCHITECTURE
182177

@@ -187,14 +182,14 @@ Three-tier MCP system:
187182

188183
## CONFIG SYSTEM
189184

190-
- **Zod validation**: `src/config/schema.ts` (12k lines)
185+
- **Zod validation**: `src/config/schema.ts`
191186
- **JSONC support**: Comments and trailing commas
192187
- **Multi-level**: User (`~/.config/opencode/`) → Project (`.opencode/`)
193188
- **CLI doctor**: Validates config and reports errors
194189

195190
## NOTES
196191

197-
- **Testing**: Bun native test (`bun test`), BDD-style `#given/#when/#then`, 82 test files
192+
- **Testing**: Bun native test (`bun test`), BDD-style `#given/#when/#then`, 80+ test files
198193
- **OpenCode**: Requires >= 1.0.150
199194
- **Multi-lang docs**: README.md (EN), README.ko.md (KO), README.ja.md (JA), README.zh-cn.md (ZH-CN)
200195
- **Config**: `~/.config/opencode/oh-my-opencode.json` (user) or `.opencode/oh-my-opencode.json` (project)

README.ja.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,7 @@ Ask @explore for the policy on this feature
548548
あなたがエディタで使っているその機能、他のエージェントは触ることができません。
549549
最高の同僚に最高の道具を渡してください。これでリファクタリングも、ナビゲーションも、分析も、エージェントが適切に行えるようになります。
550550

551-
- **lsp_goto_definition**: シンボル定義へジャンプ
552-
- **lsp_find_references**: ワークスペース全体で使用箇所を検索
553-
- **lsp_symbols**: ファイルからシンボルを取得 (scope='document') またはワークスペース全体を検索 (scope='workspace')
554551
- **lsp_diagnostics**: ビルド前にエラー/警告を取得
555-
- **lsp_servers**: 利用可能な LSP サーバー一覧
556552
- **lsp_prepare_rename**: 名前変更操作の検証
557553
- **lsp_rename**: ワークスペース全体でシンボル名を変更
558554
- **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
@@ -1051,21 +1047,18 @@ OpenCode でサポートされるすべての LSP 構成およびカスタム設
10511047
```json
10521048
{
10531049
"experimental": {
1054-
"preemptive_compaction_threshold": 0.85,
10551050
"truncate_all_tool_outputs": true,
10561051
"aggressive_truncation": true,
10571052
"auto_resume": true
10581053
}
10591054
}
10601055
```
10611056

1062-
| オプション | デフォルト | 説明 |
1063-
| --------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1064-
| `preemptive_compaction_threshold` | `0.85` | プリエンプティブコンパクションをトリガーする閾値(0.5-0.95)。`preemptive-compaction` フックはデフォルトで有効です。このオプションで閾値をカスタマイズできます。 |
1065-
| `truncate_all_tool_outputs` | `false` | ホワイトリストのツール(Grep、Glob、LSP、AST-grep)だけでなく、すべてのツール出力を切り詰めます。Tool output truncator はデフォルトで有効です - `disabled_hooks`で無効化できます。 |
1066-
| `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
1067-
| `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
1068-
| `dcp_for_compaction` | `false` | コンパクション用DCP(動的コンテキスト整理)を有効化 - トークン制限超過時に最初に実行されます。コンパクション前に重複したツール呼び出しと古いツール出力を整理します。 |
1057+
| オプション | デフォルト | 説明 |
1058+
| --------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1059+
| `truncate_all_tool_outputs` | `false` | ホワイトリストのツール(Grep、Glob、LSP、AST-grep)だけでなく、すべてのツール出力を切り詰めます。Tool output truncator はデフォルトで有効です - `disabled_hooks`で無効化できます。 |
1060+
| `aggressive_truncation` | `false` | トークン制限を超えた場合、ツール出力を積極的に切り詰めて制限内に収めます。デフォルトの切り詰めより積極的です。不十分な場合は要約/復元にフォールバックします。 |
1061+
| `auto_resume` | `false` | thinking block エラーや thinking disabled violation からの回復成功後、自動的にセッションを再開します。最後のユーザーメッセージを抽出して続行します。 |
10691062

10701063
**警告**:これらの機能は実験的であり、予期しない動作を引き起こす可能性があります。影響を理解した場合にのみ有効にしてください。
10711064

0 commit comments

Comments
 (0)