Commit Graph

314 Commits

Author SHA1 Message Date
YeonGyu-Kim 1e7a7600a2 docs(agents-md): regenerate hierarchical AGENTS.md knowledge base for v4.1.1
Refresh all AGENTS.md files to reflect codebase state at 5ffbe0e24 (was cd31d2a1a, 197 commits behind).

Key drift corrections across 45 modified + 1 new file:

Root AGENTS.md:
- TS file counts: 1967 -> 2034 in src/ (1337 source + 697 test)
- LOC: 278k -> 292k
- Barrel index.ts: 120 -> 122
- Hook tier composition: 52/59 -> 54/61 (base/with team-mode)
- Tool Guard hooks: 14 -> 16 (add fsync-skip-warning, bash-file-read-guard)
- Add boulder feature, agent-ordering schema, .agents/ directory, v4.1.1 release tag
- Add generated/ directory entry

src/AGENTS.md:
- Subsystem inventory: agents 96->102, hooks 570->581, tools 306->314,
  features 389->400, shared 258->278, cli 150->158, plugin 55->56
- LOC totals refreshed for every subsystem
- Schema files: 32 -> 30

src/hooks/AGENTS.md:
- Tier 2 (Tool Guard): 14 -> 16 hooks, add fsyncSkipWarning row
- Total: 52 base / 59 team-mode -> 54 base / 61 team-mode
- zauc-mocks count: 7 -> 5

src/features/AGENTS.md:
- background-agent: 47 -> 57 files, mention archive fallback
- opencode-skill-loader: 33 -> 30
- tmux-subagent: 34 -> 32

src/plugin/AGENTS.md:
- Tool Guard composer count: 14 -> 16
- Aggregator total: 43 -> 45

src/cli/AGENTS.md:
- Add new boulder subcommand (BoulderState inspector)
- Command count: 6 -> 7

NEW: src/features/boulder-state/AGENTS.md
- Document the new Boulder work tracking feature
- Schema v2 with BoulderState/BoulderWorkState/TaskSessionState
- Lifecycle, storage, integration points with atlas/ralph-loop hooks

All other AGENTS.md files: Generated date 2026-05-08 -> 2026-05-14.
2026-05-14 12:57:46 +09:00
YeonGyu-Kim 5ffbe0e24e fix(fallback): guard duplicate prompt injections 2026-05-14 01:03:19 +09:00
YeonGyu-Kim 36f51ddb16 fix(continuation): mark fallback resumes synthetic 2026-05-13 13:36:25 +09:00
YeonGyu-Kim d5fbada13d test: make unsafe test coercion explicit
Move test coercion out of a hidden global and require each test to import the helper so review tools and runtime scripts can see the unsafe boundary.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-12 15:51:31 +09:00
YeonGyu-Kim f05aeaa63a test(plugin): remove unsafe test assertions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-12 15:41:17 +09:00
YeonGyu-Kim 9ffef79dbb fix(ralph-loop): ignore synthetic idle replays 2026-05-12 15:28:46 +09:00
YeonGyu-Kim 4da48555ee fix(plugin): normalize event session ids
Handle OpenCode session events that carry the session ID under properties.info.id or properties.info.sessionID so background tasks and continuation hooks do not miss idle/error/delete events.

Add regression coverage for nested session.idle events completing background tasks and waking continuation hooks.
2026-05-12 12:32:26 +09:00
YeonGyu-Kim 3ed4651b7a fix(compaction): skip autocontinue for compaction agent 2026-05-11 18:46:29 +09:00
YeonGyu-Kim 0fd918ea80 fix(delegate-task): preserve native task metadata 2026-05-11 13:08:56 +09:00
YeonGyu-Kim 954aa1f121 fix(compaction): isolate preservation hook failures 2026-05-11 12:54:32 +09:00
YeonGyu-Kim 4b281f949e Merge pull request #3914 from code-yeongyu/fix/max-output-tokens
fix: prevent non-positive maxOutputTokens from leaking to SDK
2026-05-11 09:22:39 +09:00
YeonGyu-Kim 50dffc9952 Merge pull request #3911 from code-yeongyu/fix/todo-diag-blocked-alert
fix(plugin): allow real session.idle after synthetic idle within dedup window
2026-05-11 09:22:31 +09:00
YeonGyu-Kim 2f8ce576dc fix(chat-params): use conservative token fallback for invalid limits
Avoid inflating non-positive maxOutputTokens values to model capability maxima by always falling back to a safe fixed budget.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-11 08:47:49 +09:00
YeonGyu-Kim 2168040ac6 fix(plugin): scope synthetic-idle dedup bypass to matching marker
Only clear recentAnyIdles when the stored marker matches the synthetic idle timestamp for the same session, preventing accidental clobbering of newer idle markers. Add a regression test to verify other sessions keep their dedup state during this bypass path.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-11 08:45:34 +09:00
acamq 299275094f Revert "fix(tool-execute-after): cap excessively long tool output to prevent TUI flooding (fixes #3586)" 2026-05-10 17:33:36 -06:00
YeonGyu-Kim 41629b5262 fix(plugin): guard assistant prefill message tails 2026-05-10 15:54:29 +09:00
YeonGyu-Kim 279f0d150f fix(chat-params): guard non-positive max output tokens 2026-05-10 15:03:01 +09:00
YeonGyu-Kim a196d84c2e fix(plugin): allow real session.idle after synthetic idle within dedup window
When session.status(idle) is converted to synthetic session.idle and recorded in recentAnyIdles, a real session.idle arriving within 500ms was being dropped by the dedup logic. recentSyntheticIdles was cleared but recentAnyIdles persisted, causing TODO-DIAG to red-alert with 'no todossession.idle event'.

Fix: when real session.idle arrives, also clear recentAnyIdles entry so dedup does not drop it. Test renamed and expected dispatchCalls updated 1 → 2.

Fixes #2667
2026-05-10 14:54:01 +09:00
YeonGyu-Kim dd29e9b96a fix(compaction): restore context and todos before continue 2026-05-10 13:54:27 +09:00
YeonGyu-Kim 43b0529557 feat(hooks): surface fsync-skip warnings to AI agent via tool output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-08 15:08:34 +09:00
YeonGyu-Kim 838b5ae216 docs(agents): refresh hierarchical AGENTS.md with team-mode coverage
Update root + 43 directory-level AGENTS.md files to reflect current state:
- Root AGENTS.md rewritten with accurate counts (1967 TS files, 1304 source +
  663 test, 278k LOC, 120 barrel index.ts), 7-step init flow, 5-tier hook
  composition, and full Team Mode section (12 team_* tools, eligibility,
  storage layout, config gate)
- src/AGENTS.md adds team-mode init step, current per-subdir file/LOC table
- src/tools/AGENTS.md documents conditional gates (team-mode +12, task
  system +4, hashline +1, interactive_bash +1, look_at +1) with always-on
  baseline of 20
- src/hooks/AGENTS.md splits into 5 tiers + 4 conditional team-mode hooks
- src/features/team-mode/AGENTS.md surfaces 12 tools, eligible agents,
  spawn-race-safe invariants, and integration points
- src/features/builtin-skills/AGENTS.md tracks 10 skills incl. team-mode
- src/agents/AGENTS.md, src/plugin/AGENTS.md, src/config/AGENTS.md updated
  for team-mode awareness, accurate counts, and current schema field list
- All other AGENTS.md files refreshed to 2026-05-08 generation date
2026-05-08 12:08:42 +09:00
YeonGyu-Kim ee938aa097 fix full-suite isolation regressions 2026-05-07 18:36:03 +09:00
herjarsa 3a93a40e68 fix(desktop): hide bun:sqlite import from Node.js/Electron ESM loader
Uses new Function() to prevent the static ESM loader from seeing
the bun: protocol import at parse time. In Electron/Node.js, the
import() call is evaluated at runtime and gracefully returns null
when bun:sqlite is unavailable.

Fixes #3829, likely fixes #3762
2026-05-07 10:38:31 +02:00
YeonGyu-Kim 1ad0fd4ac8 Merge pull request #3748 from code-yeongyu/fix/simple-github-bugs-1948-3564
fix: resolve simple triaged GitHub bugs
2026-05-06 18:43:58 +09:00
YeonGyu-Kim 9dd0e9fb0e Merge pull request #3622 from MoerAI/fix/truncate-tool-error-output
fix(tool-execute-after): cap excessively long tool output to prevent TUI flooding (fixes #3586)
2026-05-06 17:22:53 +09:00
YeonGyu-Kim 62a7356de3 Merge pull request #3621 from MoerAI/fix/skill-tool-respects-plugins-config
fix(tool-registry): pass plugins config to skill tool for proper command filtering (fixes #3582)
2026-05-06 17:15:01 +09:00
Samuele Domenico Ruffino 6cd40df4cb feat(opencode-go): upgrade glm-5 → glm-5.1 and kimi-k2.5 → kimi-k2.6 in fallback chains 2026-05-06 16:45:30 +09:00
YeonGyu-Kim 267745fa2f test(plugin): remove forbidden assertions in event tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 91b7fcab3a fix(plugin): replace any type with explicit summarize overloads in event handler
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 91c0d75588 feat(keyword-detector): add per-keyword disable config
Adds keyword_detector.disabled_keywords config so users can opt out of
specific keyword detectors individually without disabling the entire
keyword-detector hook. Allowed values: 'ultrawork', 'search', 'analyze',
'team'. Default empty/missing -> all four detectors active (no behavior
change for existing configs).

Motivation: an audit revealed search and analyze patterns trigger on
~30-60% of normal conversational user messages (e.g. 'how to', 'why is',
'show me', '왜', '어떻게'). The disable list is the immediate kill switch
while the patterns themselves are tightened in a separate PR.

Schema follows the existing per-feature config block convention shared
by team_mode, ralph_loop, runtime_fallback, and comment_checker. The
KeywordType enum (z.enum) lives next to the config schema and is
re-imported by the detector to keep the union type in lockstep with the
schema.

Threading:
  pluginConfig.keyword_detector
    -> create-transform-hooks.ts (factory wiring)
    -> createKeywordDetectorHook(config)
    -> detectKeywordsWithType(text, agent, model, disabledKeywords)
    -> Set-based filter at the source-of-truth detector

Adds 8 regression tests covering per-keyword disable, multi-keyword
disable, partial disable (one keyword off, another still firing),
ultrawork toast suppression, undefined config, and empty array.
2026-05-06 14:19:40 +09:00
YeonGyu-Kim 20a66f7061 feat(plugin): wire team-mode into tool-guard and transform hook creation 2026-05-06 14:19:40 +09:00
YeonGyu-Kim d67e57ef3e feat(plugin): include team-mode in message transform and skill context 2026-05-06 14:19:39 +09:00
YeonGyu-Kim dabd35f266 feat(plugin): integrate team-mode into session events and synthetic idles 2026-05-06 14:19:39 +09:00
YeonGyu-Kim f882f04bb0 feat(plugin): add team-mode gating to tool execute hooks 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 47e0fbad49 feat(plugin): register team-mode tools and expand registry tests 2026-05-06 14:19:39 +09:00
YeonGyu-Kim aae619c58f fix(ultrawork): align lazy sqlite fallback test
Keep bun:sqlite loading lazy and verify the unavailable-runtime fallback without a test-only importer seam.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-05 19:09:31 +09:00
YeonGyu-Kim c537e840ee fix(ultrawork): handle bun:sqlite import failure directly
Use the lazy bun:sqlite importer inside the deferred override microtask and keep the unavailable-runtime test on the rejected-import path.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-05 19:09:31 +09:00
YeonGyu-Kim f4a225b6cd fix(ultrawork): lazy-load bun:sqlite to support Node/Electron runtime
Top-level `import { Database } from 'bun:sqlite'` caused Node/Electron's
ESM loader to reject the plugin at module-graph resolution time because
the `bun:` protocol is not in Node's allowed scheme list. This prevented
the OpenCode desktop app from loading the plugin at all.

Fix:
- Remove top-level static import of `bun:sqlite`
- Use a lazy importer (`_bunSqliteImporter`) that calls
  `import('bun:sqlite').catch(() => null)` at runtime
- If the import returns null (non-Bun environment), log a warning and
  return early — no DB override attempted, plugin loads normally
- Expose `__setBunSqliteImporterForTesting` / `__resetBunSqliteImporterForTesting`
  test seams to verify the Node/Electron fallback path

Closes #3795
2026-05-05 19:09:31 +09:00
YeonGyu-Kim 793f24a62f Merge pull request #3715 from mrosnerr/fix/messages-transform-hook-isolation
fix(messages-transform): isolate hook failures so tool-pair-validator always runs
2026-05-01 19:18:31 +09:00
YeonGyu-Kim 9c4bcebb22 fix(plugin): normalize bare schema refs
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-01 18:55:57 +09:00
Choi Kijin / 최 기진 / チョイ キジン 7adb725960 Merge remote-tracking branch 'origin/dev' into fix/retry-recovery-and-observability 2026-04-29 12:25:02 +09:00
mrosnerr 69a4b2f49c fix(messages-transform): isolate hook failures so tool-pair-validator always runs
Previously each transform hook was awaited sequentially without per-hook
error handling. If contextInjectorMessagesTransform or thinkingBlockValidator
threw, toolPairValidator was silently skipped, leaving orphaned tool_use
blocks in the post-compaction API payload and producing
"messages.N: tool_use ids were found without tool_result blocks immediately
after" 400s from Anthropic.

Wraps each hook in runHookSafely so an upstream throw is logged but the
chain continues. Adds regression tests covering the isolation contract and
the consecutive-assistants compaction tail case (ses_22bd806).
2026-04-28 17:38:28 -04:00
Choi Kijin / 최 기진 / チョイ キジン 27fb2d5e79 test(plugin): clean up event handler test helpers
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 19:09:02 +09:00
YeonGyu-Kim ece8fd4f25 perf(shared): cache context window usage per session
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 17:59:25 +09:00
Choi Kijin / 최 기진 / チョイ キジン 3fc9e6bafd Merge remote-tracking branch 'origin/dev' into opencode/mighty-wolf 2026-04-28 15:47:58 +09:00
Choi Kijin / 최 기진 / チョイ キジン 25548f2561 fix(model-fallback): retry forbidden provider errors
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-28 15:29:33 +09:00
YeonGyu-Kim 333ad3aadd refactor(agents): drop ZWSP prefixes from agent display names
The sort shim from the previous commit enforces canonical core ordering at runtime, so ZWSP prefixes are no longer needed. Removing them eliminates the Bun.stringWidth vs terminal-width drift that broke the TUI status bar (#3259).

Drop AGENT_LIST_SORT_PREFIXES and getAgentRuntimeName from agent-display-names; switch all call sites to getAgentDisplayName. getAgentListDisplayName stays as a thin alias for external importers.

Keep stripInvisibleAgentCharacters and the ZWSP regex paths so legacy session state and configs from v3.14.0-v3.16.0 still resolve.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 18:59:49 +09:00
YeonGyu-Kim d0dee70f9d fix(ralph-loop): skip idle continuation during background tasks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 17:52:45 +09:00
YeonGyu-Kim f1d4eb7846 fix(skill-context): filter dev-browser as provider-gated
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-27 17:31:07 +09:00
MoerAI 7fa21efc2a fix(chat-message): remove unreachable guard that blocked session model recovery (fixes #3561) 2026-04-24 19:06:08 +09:00