Commit Graph

798 Commits

Author SHA1 Message Date
YeonGyu-Kim 01a1b141e9 fix(delegate-task): reject primary agents in task subagent resolution
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-13 17:03:37 +09:00
YeonGyu-Kim 680d05a28b Prometheus: keep planner primary-only 2026-04-13 14:28:07 +09:00
code-yeongyu 3053d5901a Merge branch 'dev' into fix/user-agents-callable-v2
Resolves conflicts with ZWSP agent ordering, display name unification, and test file migration to zauc-mocks split.
2026-04-12 06:13:52 +09:00
YeonGyu-Kim c5c5bc36bc fix(delegate-task): consume fallback chain on sendSyncPrompt failure (#2691)
setSessionFallbackChain stored the fallback chain but the sync path
never consumed it when sendSyncPrompt returned an error. Added a
retry loop that iterates getNextFallback() until the prompt succeeds
or the chain is exhausted, preserving the finally-block cleanup.

🤖 Generated with OhMyOpenCode assistance
https://github.com/code-yeongyu/oh-my-opencode
2026-04-12 02:30:32 +09:00
YeonGyu-Kim aed8dbfa3e fix(delegate-task): fetch session result before honoring abort signal (#2702)
The sync poller returned 'Task aborted' immediately when the abort
signal fired, even when a terminal assistant message had already
arrived during the previous wait. Now attempts one final fetch and
returns the completion result if available before emitting the
abort message.

🤖 Generated with OhMyOpenCode assistance
https://github.com/code-yeongyu/oh-my-opencode
2026-04-12 02:30:22 +09:00
YeonGyu-Kim d7b4bec58b fix(hooks,tools): replace /plan example with prometheus delegation and rename code-review example to review-work (#2633, #3285, #2873)
- context-info-builder referenced a non-existent /plan command;
  now directs users to the Prometheus agent for planning
- skill tool description example referenced 'code-review' which
  does not exist; changed to 'review-work' (actual built-in skill)
- skill tool execute path now surfaces the missing host permission
  gap so callers understand OpenCode plugin context limits

🤖 Generated with OhMyOpenCode assistance
https://github.com/code-yeongyu/oh-my-opencode
2026-04-12 02:28:58 +09:00
YeonGyu-Kim a6e4f211a3 fix(shared): normalize claude model IDs for anthropic provider (#3290)
Anthropic API accepts claude-opus-4.6 (dot format) but not
claude-opus-4-6 (dash format). Added anthropic case to
transformModelForProvider to normalize dash-format model IDs before
they reach the provider. Updated model config snapshots and test
expectations to match the new dot-format output.

🤖 Generated with OhMyOpenCode assistance
https://github.com/code-yeongyu/oh-my-opencode
2026-04-12 02:28:27 +09:00
YeonGyu-Kim 0c5cd3a1c4 chore(agents): update all AGENTS.md generation dates to 2026-04-11
🤖 Generated with OhMyOpenCode assistance
2026-04-11 22:33:22 +09:00
YeonGyu-Kim a442976d77 Fix invisible characters in agent names 2026-04-11 20:44:57 +09:00
YeonGyu-Kim 9f135af41c fix: unify agent display names and strip invisible sort prefixes
- Replace getAgentRuntimeName with getAgentDisplayName for consistency
- Add stripAgentListSortPrefix helper to normalize agent names
- Strip sort prefixes in subagent-resolver and sync-executor
- Backfill canonical names for core agents when builtin configs omit name
- Update tests to match new behavior
2026-04-11 14:53:01 +09:00
YeonGyu-Kim 37057f18b9 test(tools): update MCP, delegate-task, skill, and slashcommand tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:35 +09:00
YeonGyu-Kim fba3e1b3f7 fix(tools): improve delegate task constants and sync handling
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:14 +09:00
YeonGyu-Kim 7244d048fb feat(session-manager): implement session management tools
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 15:53:08 +09:00
YeonGyu-Kim c173fa8f24 delegate-task: block prometheus task delegation 2026-04-10 13:42:53 +09:00
YeonGyu-Kim 33ac57ba7a refactor: update remaining modules to use plugin-identity constants
Update various modules to use centralized constants from plugin-identity:
- get-local-version/formatter: Use PUBLISHED_PACKAGE_NAME
- run/session-resolver: Use PUBLISHED_PACKAGE_NAME
- background-agent/task-poller: Use PUBLISHED_PACKAGE_NAME
- mcp-oauth/provider: Use PUBLISHED_PACKAGE_NAME
- auto-update-checker/constants: Use ACCEPTED_PACKAGE_NAMES
- comment-checker/downloader: Use PUBLISHED_PACKAGE_NAME
- legacy-plugin-toast/hook: Use PLUGIN_NAME
- shared/data-path: Use CACHE_DIR_NAME
- shared/external-plugin-detector: Use ACCEPTED_PACKAGE_NAMES
- shared/logger: Use LOG_FILENAME
- tools/ast-grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/call-omo-agent/tools: Use PUBLISHED_PACKAGE_NAME
- tools/delegate-task/category-resolver: Use PUBLISHED_PACKAGE_NAME
- tools/grep/constants: Use PUBLISHED_PACKAGE_NAME
- tools/grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/lsp/lsp-client-wrapper: Use PUBLISHED_PACKAGE_NAME

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 11:16:16 +09:00
GeonWoo Jeon (Jay) ade57474be fix(merge): resolve dev conflicts for openclaw branch 2026-04-09 12:23:38 +09:00
GeonWoo Jeon (Jay) e5189f2164 fix(test): wait for async skill description refresh 2026-04-09 12:09:09 +09:00
YeonGyu-Kim 545c444a85 Merge remote-tracking branch 'origin/dev' into fix/delegate-task-depth-guard-rebased 2026-04-09 11:06:31 +09:00
YeonGyu-Kim bdf6e4195a Merge pull request #3225 from code-yeongyu/fix/agent-name-safety
fix(agent): narrow ULW auto-start + strip ZWSP on background path + fix auto-update identity
2026-04-08 17:40:48 +09:00
YeonGyu-Kim 359f74132a fix(delegate-task): strip ZWSP from agent names on background launch path
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 17:17:26 +09:00
YeonGyu-Kim ed16dc0608 fix(chat-params): complete maxOutputTokens migration in session prompt params 2026-04-08 17:14:17 +09:00
YeonGyu-Kim 94449e0a24 test(delegate-task): update isPlanAgent test for exact match fix
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:33:18 +09:00
YeonGyu-Kim 35f778db2d test(skill-mcp): add scope field to test fixtures
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:11:28 +09:00
YeonGyu-Kim fa140b0375 fix(skill-loader): propagate scope to MCP connections
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:10:41 +09:00
YeonGyu-Kim a419857b46 fix(delegate-task): use exact match for isPlanFamily to allow Metis/Momus
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:09:31 +09:00
YeonGyu-Kim e8d83b5f98 fix(zwsp): strip zero-width chars in delegate-task tools
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:02:05 +09:00
YeonGyu-Kim 5188df903f fix(types): revert task-tool type inference workarounds
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:00:17 +09:00
YeonGyu-Kim ae3a8d628b fix(delegate-task): tighten subagent depth guard + add regression smoke tests
The depth limit (default maxDepth=3) was being silently bypassed when
sync-task.ts could not reach the manager's spawn enforcement methods --
the fallback hardcoded childDepth: 1, allowing infinite recursion of
delegate_task calls in degraded environments.

This was hard to catch because:
1. The fallback path took the dangerous default silently (no log).
2. There were no end-to-end smoke tests asserting that the depth value
   coming back from reserveSubagentSpawn is actually used.
3. The unit tests for resolveSubagentSpawnContext only covered error
   cases, not the actual depth calculation.

Changes:
- sync-task.ts: split the spawnContext fallback into an explicit if/else
  with a WARNING log when the manager is missing enforcement methods.
  This makes the dangerous path observable in logs.
- subagent-spawn-limits.test.ts: add depth calculation regression tests
  (root, depth-1, depth-2, depth at max, parent cycle detection).
- sync-task.test.ts: add two regression smoke tests:
  1. depth limit error from reserveSubagentSpawn must be propagated and
     must NOT create the session.
  2. spawnDepth recorded in metadata must equal what reserveSubagentSpawn
     returns -- guards against silent fallback to childDepth: 1.

15 new spawn-limits tests + 2 new sync-task tests pass.
Full suite: 5105 pass, 0 fail.
2026-04-07 19:56:51 +09:00
YeonGyu-Kim 62cc74b23e Merge pull request #3187 from code-yeongyu/fix/issue-2687
fix: propagate project skills to background task sessions (#2687)
2026-04-07 15:35:28 +09:00
YeonGyu-Kim 505c7ef0cf Merge pull request #3184 from code-yeongyu/fix/issue-3163
fix: allow variant override even with agent model config (#3163)
2026-04-07 15:33:58 +09:00
YeonGyu-Kim 2465205356 fix: propagate project skills to background task sessions (#2687)
prompt-builder.ts now includes project-level skills from
.opencode/skills/ when building delegated session prompts.

5007 tests pass, tsc clean.

Closes #2687
2026-04-07 15:29:16 +09:00
YeonGyu-Kim ee8410ce03 fix: allow variant override even with agent model config (#3163)
model-selection.ts now separates model selection from variant/reasoning
tier, so agent model overrides don't lock the variant.

34 tests pass, 5009 total, tsc clean.

Closes #3163
2026-04-07 15:29:12 +09:00
YeonGyu-Kim 5622d154fd fix: prevent background agent race condition in session prompt (#2932)
Added await for session ready state before sending prompt in
background-agent/manager.ts. Also improved image resizer error handling.

132 tests pass, tsc clean.

Closes #2932
2026-04-07 15:29:11 +09:00
YeonGyu-Kim 062b8cd718 Merge pull request #3169 from code-yeongyu/fix/sisyphus-junior-model
fix(model-fallback): respect user model override for sisyphus-junior category sessions (#2941)
2026-04-07 15:14:09 +09:00
YeonGyu-Kim 5db6bfd97d Merge pull request #3174 from code-yeongyu/fix/issue-3033
fix(look-at): make multimodal-looker prompt conditional on Read availability (#3033)
2026-04-07 15:14:01 +09:00
YeonGyu-Kim b1c536ddd8 fix(look-at): make multimodal-looker prompt conditional on Read availability (#3033)
When Read tool is disabled (attachment mode), the agent prompt now
instructs to analyze the attached content directly instead of
trying to use Read. 3 new tests, 55 total pass.

Closes #3033
2026-04-07 15:11:26 +09:00
YeonGyu-Kim 889294a5fd fix(model-fallback): respect user model override for sisyphus-junior category sessions (#2941)
When users configure agents.sisyphus-junior.model, category sessions
should use that model without falling back to hardcoded
AGENT_MODEL_REQUIREMENTS. Two leaks existed:

1. Launch-time: category-resolver.ts did not check overrideModel when
   deciding whether to use the hardcoded fallbackChain. Fixed by adding
   overrideModel to the suppression condition.

2. Runtime retry: model-fallback hook.ts treated undefined fallbackChain
   (from setSessionFallbackChain(id, undefined)) as 'no override' and
   fell through to AGENT_MODEL_REQUIREMENTS on session.error/status
   retry. Fixed by storing explicit empty array and checking .has()
   instead of truthiness.

Tests added:
- hook.test.ts: explicit empty session fallback suppresses agent chain
- event.model-fallback-2941.test.ts: session.error does not arm retry
- category-resolver.test.ts: overrideModel suppresses fallbackChain
- tools.test.ts: sisyphusJuniorModel override assertion
2026-04-07 11:20:42 +09:00
YeonGyu-Kim f8c626086e fix(agent-names): use HTTP-header-safe display names and config keys for API calls (#3138)
Display names with parentheses like 'Atlas (Plan Executor)' cause HTTP
header validation errors in x-opencode-agent-name. This was blocking
Atlas/Prometheus from working via /start-work and auto-retry.

Changes:
- Display names: parens -> dashes ('Atlas - Plan Executor')
- Hooks (start-work, no-hephaestus-non-gpt, no-sisyphus-gpt): use
  config keys ('atlas', 'sisyphus', 'hephaestus') for agent API fields
- auto-retry: use config key instead of display name for promptAsync
- agent-override-protection: handle dash-suffix normalization
- Updated all test expectations to match new format

Closes #3138
2026-04-07 10:08:04 +09:00
YeonGyu-Kim bd37e6676a fix(delegate-task): make description optional with auto-generation from prompt (#3162)
When weaker models (GLM-5, MiniMax) omit the description parameter on
delegate_task, the tool now auto-generates it from the first 4 words of
the prompt instead of throwing an error.

Changes:
- Schema: description is now optional (tool.schema.string().optional())
- Runtime: auto-generates from prompt when missing/empty/whitespace
- DelegateTaskArgs.description type stays as string (guaranteed by auto-gen)
- Tests: 3 new cases - missing/empty/explicit description handling
- Metadata title set after description resolution (correct ordering)
2026-04-07 09:30:22 +09:00
YeonGyu-Kim 137c2459f7 fix(prompt): prevent immediate BackgroundOutput polling after background task launch
Tool return values contained CTAs ("Use background_output to check") that
caused models to immediately poll instead of waiting for <system-reminder>
notifications. Unified all 5 tool return messages with explicit "Do NOT call
background_output now" guard, added pre-notification warning to BackgroundOutput
tool description, and strengthened Background Result Collection sections across
all 3 Sisyphus prompt variants (default, gpt-5-4, main) with BLOCKING
anti-pattern enforcement.

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-04-06 17:18:47 +09:00
YeonGyu-Kim 213cee27cc fix(types): resolve zod v3 type inference differences in task tools
zod v3 infers .default([]) fields as string[] | undefined in z.infer
output type (unlike v4 which marks them as string[]). Add nullish
coalescing guards and use any[] for the readJsonSafe result array
to avoid the type mismatch in task-list and task-update.
2026-04-06 14:20:30 +09:00
YeonGyu-Kim afd554b2d9 fix(delegate-task): validate description parameter and handle undefined in notifications
OpenCode's fromPlugin wrapper skips Zod validation for plugin tools, so
LLMs can omit required args like description without getting an error.
When Atlas orchestrates and the model omits description, it flows through
as undefined to manager.launch() and background task notifications show
'undefined' for all completed tasks.

Two fixes:
- Add runtime validation for description in delegate-task tool (matches
  existing run_in_background and load_skills validation pattern)
- Defensive fallback in notification template: use task ID when
  description is missing instead of rendering 'undefined'
2026-04-05 17:18:10 +09:00
YeonGyu-Kim d5dfaaa3ad fix(delegate-task): remove kimi from unstable agent detection, harden callID resolution for metadata store
- Remove kimi from auto-detected unstable agents in category-resolver (only gemini/minimax remain)
- Add resolveCallID() to safely resolve callID/callId/call_id variants from tool context
- Use resolveCallID across all 5 delegate task execution paths (sync, background, unstable, continuations)
- Update writing category test to verify kimi runs sync when kimi provider is available
- Add atlas metadata preservation tests confirming tool-execute-after does not clobber metadata

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-05 15:30:36 +09:00
auyua9 0bb16e5149 fix(session-manager): use sdk data in getSessionInfo 2026-04-05 14:38:13 +09:00
YeonGyu-Kim 7b7526e2f6 docs(src): update counts across tools, features, config, cli AGENTS.md
- tools: 15 -> 16 dirs, writing model kimi-k2p5 -> gemini-3-flash
- features: builtin skills 6 -> 8 (+review-work, +ai-slop-remover)
- config: schema files 24 -> 27 (+git-env-prefix, model-capabilities, openclaw)
- cli: commands 5 -> 6 (+refresh-model-capabilities)
- plugin-handlers: 13 -> 14 non-test files
- shared: 95+ -> 100+ utility files
2026-04-05 14:12:31 +09:00
YeonGyu-Kim 130f4ac080 fix: resolve #3124 #3125 #3127 session tools, cache priming, and compaction loop
- #3124: Session tools now merge SDK and file-backed sessions for SQLite backend
- #3125: Cache priming fixed for OpenCode >=1.3.14 empty workspace
- #3127: Activity-based progress detection prevents infinite compaction on Kimi/Minimax

All 29 new tests pass, 4885 total tests passing.
2026-04-05 09:30:19 +09:00
YeonGyu-Kim da86b57f23 test: fix CI test isolation - upgrade Bun, fix mock contamination and fresh-import patterns 2026-04-05 01:01:19 +09:00
YeonGyu-Kim acfed926f8 test: isolate subagent-resolver.test.ts to prevent mock contamination 2026-04-04 21:31:28 +09:00
YeonGyu-Kim feaa674963 test: fix imports for mcp-index and subagent-resolver isolation 2026-04-04 21:30:42 +09:00
YeonGyu-Kim ba26b6f29d test: isolate skill-tools and mcp-index tests to prevent mock contamination
Moves test files with mock.module() calls into zauc-mocks-* directories
to prevent process-global mock pollution affecting subsequent tests.

- src/tools/skill/tools.test.ts -> zauc-mocks-skill-tools/
- src/mcp/index.test.ts -> zauc-mocks-mcp-index/

Fixes remaining 21 CI failures (resolveSubagentExecution + slashcommand).
2026-04-04 20:49:47 +09:00