chore: regenerate AGENTS.md knowledge base

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
This commit is contained in:
YeonGyu-Kim
2026-02-18 01:26:19 +09:00
parent 04e95d7e27
commit 3313ec3e4f
11 changed files with 400 additions and 17 deletions
+7 -4
View File
@@ -1,14 +1,14 @@
# src/hooks/ — 41 Lifecycle Hooks
# src/hooks/ — 44 Lifecycle Hooks
**Generated:** 2026-02-17
**Generated:** 2026-02-18
## OVERVIEW
41 hooks across 37 directories + 6 standalone files. Three-tier composition: Core(33) + Continuation(7) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern.
44 hooks across 39 directories + 6 standalone files. Three-tier composition: Core(35) + Continuation(7) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern.
## HOOK TIERS
### Tier 1: Session Hooks (20) — `create-session-hooks.ts`
### Tier 1: Session Hooks (22) — `create-session-hooks.ts`
| Hook | Event | Purpose |
|------|-------|---------|
@@ -31,6 +31,9 @@
| questionLabelTruncator | tool.execute.before | Truncate long question labels |
| taskResumeInfo | chat.message | Inject task context on resume |
| anthropicEffort | chat.params | Adjust reasoning effort level |
| jsonErrorRecovery | tool.execute.after | Detect JSON parse errors, inject correction reminder |
| sisyphusGptHephaestusReminder | chat.message | Toast warning when Sisyphus uses GPT model |
| taskReminder | tool.execute.after | Remind about task tools after 10 turns without usage |
### Tier 2: Tool Guard Hooks (9) — `create-tool-guard-hooks.ts`
@@ -0,0 +1,49 @@
# src/hooks/anthropic-context-window-limit-recovery/ — Multi-Strategy Context Recovery
**Generated:** 2026-02-18
## OVERVIEW
31 files (~2232 LOC). Most complex hook. Recovers from context window limit errors via multiple strategies applied in sequence.
## RECOVERY STRATEGIES (in priority order)
| Strategy | File | Mechanism |
|----------|------|-----------|
| **Empty content recovery** | `empty-content-recovery.ts` | Handle empty/null content blocks in messages |
| **Deduplication** | `deduplication-recovery.ts` | Remove duplicate tool results from context |
| **Target-token truncation** | `target-token-truncation.ts` | Truncate largest tool outputs to fit target ratio |
| **Aggressive truncation** | `aggressive-truncation-strategy.ts` | Last-resort truncation with minimal output preservation |
| **Summarize retry** | `summarize-retry-strategy.ts` | Compaction + summarization then retry |
## KEY FILES
| File | Purpose |
|------|---------|
| `recovery-hook.ts` | Main hook entry — `session.error` handler, strategy orchestration |
| `executor.ts` | Execute recovery strategies in sequence |
| `parser.ts` | Parse Anthropic token limit error messages |
| `state.ts` | `AutoCompactState` — per-session retry/truncation tracking |
| `types.ts` | `ParsedTokenLimitError`, `RetryState`, `TruncateState`, config constants |
| `storage.ts` | Persist tool results for later truncation |
| `tool-result-storage.ts` | Store/retrieve individual tool call results |
| `message-builder.ts` | Build retry messages after recovery |
## RETRY CONFIG
- Max attempts: 2
- Initial delay: 2s, backoff ×2, max 30s
- Max truncation attempts: 20
- Target token ratio: 0.5 (truncate to 50% of limit)
- Chars per token estimate: 4
## PRUNING SYSTEM
`pruning-*.ts` files handle intelligent output pruning:
- `pruning-deduplication.ts` — Remove duplicate content across tool results
- `pruning-tool-output-truncation.ts` — Truncate oversized tool outputs
- `pruning-types.ts` — Pruning-specific type definitions
## SDK VARIANTS
`empty-content-recovery-sdk.ts` and `tool-result-storage-sdk.ts` provide SDK-based implementations for OpenCode client interactions.