Commit Graph

1135 Commits

Author SHA1 Message Date
YeonGyu-Kim 897b5b27b3 fix(skills): register security skills for profiles 2026-05-30 21:30:10 +09:00
YeonGyu-Kim f9172c6c28 fix(skills): register security skills at runtime 2026-05-30 20:38:59 +09:00
YeonGyu-Kim 855d191bf3 fix(skills): register security-research builtin 2026-05-30 19:45:56 +09:00
YeonGyu-Kim b5e5fce236 fix(skills): register security-review builtin 2026-05-30 19:32:26 +09:00
YeonGyu-Kim 0691779d2e fix(background-agent): unblock stale parent wakes 2026-05-29 13:36:38 +09:00
YeonGyu-Kim 359baab4ec fix(background-agent): align wake activity windows 2026-05-28 18:14:52 +09:00
YeonGyu-Kim abe7381c91 fix(background-agent): defer unsafe parent wakes 2026-05-28 18:14:44 +09:00
YeonGyu-Kim 4635d61ada fix(background-agent): defer parent wake during active turns 2026-05-27 16:17:30 +09:00
YeonGyu-Kim f204390b43 fix: reserve completed heading for final background wake 2026-05-27 14:27:26 +09:00
ToToKr b7ac05a9b5 Merge pull request #4248 from MoerAI/fix/getskillbyname-short-name
fix(opencode-skill-loader): align getSkillByName with short-name matching (fixes #4183)
2026-05-27 13:40:46 +09:00
YeonGyu-Kim 9a9ff8674e fix(builtin-skills): document Codex tool mapping 2026-05-27 00:34:37 +09:00
YeonGyu-Kim f9bbe0517b fix(team-mode): fix lifecycle-test-fixture ask type + update bun.lock 2026-05-26 18:51:25 +09:00
YeonGyu-Kim 52ba1257b6 Merge branch 'fix/pre-publish-blockers-v4.5.0'
Pre-publish blockers for v4.5.0:
- fix(runtime-fallback): gate retryable signal on status-code allowlist (f05e0cbe9)
- fix(parent-wake): bound assistant-text defer to escape stuck sessions (69c955f61)
- fix(ralph-loop): time-bound oracle dispatch wait to prevent stall (14b3523af)
- test(dist-bundle): assert inlined prompt content survives bundling (3e0a975d1)
- fix(package): block internal-only assets from publish payload (8e28e29c2)

Verified via publish-debate-vortex hyperultradebate (6 hostile agents, 3 rounds).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 16:44:50 +09:00
YeonGyu-Kim 3b421c6ed3 fix(background-agent): isolate dispatched parent wake failures
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 01:42:56 +09:00
YeonGyu-Kim ec7ce51ea6 fix(background-agent): debounce active parent wake flushes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 01:30:17 +09:00
YeonGyu-Kim 6a561446ec fix(background-agent): deliver completion wakes during active parent turns
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-26 01:30:17 +09:00
YeonGyu-Kim 6551f3893c fix(background-agent): retry Atlas subagents on usage limits
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-25 17:09:52 +09:00
YeonGyu-Kim 69c955f61f fix(parent-wake): bound assistant-text defer to escape stuck sessions
shouldDeferParentWakeForSessionHistory previously had only one escape
path from the defer state: stale pending tool call. If the assistant
had unfinished text but no pending tool call (session crashed
mid-stream, model errored after partial text, network died), the
escape never fired and parent-wake deferred forever. Background-agent
completions never woke the parent.

Add a second escape: when the assistant text blocks but no tool wait
is pending, dispatch the wake after toolCallDeferMaxMs anyway. The
prompt-async-gate still defends if the assistant text turns out to be
live; we just stop deferring indefinitely.

Closes pre-publish blocker V11.
2026-05-25 01:32:35 +09:00
YeonGyu-Kim 3d0b4c4aac fix(parent-wake): block unfinished assistant wakes 2026-05-24 19:02:13 +09:00
YeonGyu-Kim 39a549a3df Merge pull request #4381 from code-yeongyu/fix/team-mode-closure-prompts
fix(team-mode): make lead close teams on its own initiative
2026-05-24 15:37:28 +09:00
YeonGyu-Kim 5f1fb0c52a fix(team-mode): make lead close teams on its own initiative
The lead currently leaves teams alive after the task list drains because
none of the prompt surfaces tell it WHEN to close or HOW. omx-style
'self-closing' behavior was missing for four reasons (diagnosed via
prompt-engineering A/B/C: wrong / misframed / missing):

1. builtin team-mode skill 'Lifecycle' (B+C): 'phase ends / shape
   outgrown' is qualitative, so the model maps it to 'wait for user'.
   Step 6 jumped to team_delete without the request/approve pair the
   tool contract requires. Replaced with a 'Closure Contract' (a
   computable predicate over team_task_list + team_status) and an
   explicit 'Closure Sequence' (request -> approve -> delete, with
   force=true reserved for unrecoverable paths only).

2. TEAM_MESSAGE keyword injection (C): spent 100%% of its one-shot
   budget on routing ('do not substitute delegate_task'), 0%% on
   closure. Added the same closure rule in compressed form. Kept the
   'NEVER substitute with delegate_task' literal that
   keyword-detector/index.test.ts depends on.

3. team-mode-status-injector body (C): the only per-session injection
   for team mode had no closure obligation. Replaced the optional
   'load the team-mode skill ... otherwise use the team_* tools'
   sentence with a 'Closure invariant' clause that ties the check to
   every team_task_update.

4. member-guidance Wrap-up (A+B): step 3 said 'so the lead can decide
   whether to request shutdown', but team_shutdown_request is
   lead-only - members cannot initiate it. Step ordering also placed
   the completion message before team_task_update, so the lead's
   closable check would see stale data. Reordered to
   task_update -> check task_list for new work -> if nothing left,
   send a single 'closure-ready' message and idle. Test assertion
   updated to match the new accurate contract.

Also: stripped Korean alternation from TEAM_PATTERN per directive
('절대로 코드 내에 한국어 적지 마라'). Pattern is now
/\\bteam[\\s_-]?mode\\b/i. Removed 4 Korean test cases
(2 positive triggers + 2 false-positive guards) that the pattern no
longer needs to defend, and updated the keyword-detector AGENTS.md
row.

Net: -71 lines across prompt surfaces. The Closure Contract is the
only addition; everything else tightened.

Tests: 428/428 pass across src/features/team-mode/,
src/features/builtin-skills/, src/hooks/keyword-detector/,
src/hooks/team-mode-status-injector/, src/hooks/team-mailbox-injector/,
src/hooks/team-tool-gating/, src/hooks/team-session-events/.
LSP: no errors introduced (one pre-existing error in
keyword-detector/index.test.ts confirmed pre-existing on dev).
2026-05-24 15:21:24 +09:00
YeonGyu-Kim b3097e5693 fix(background-agent): suppress redundant parent wakes 2026-05-24 01:07:38 +09:00
YeonGyu-Kim 9e5c431817 Merge pull request #4297 from SpencerJung/fix/issue-4128-desktop-sidecar-crash
fix(background-agent): keep cleanup error listener active
2026-05-22 22:04:54 +09:00
YeonGyu-Kim 560569e369 fix(parent-wake-notifier): drop duplicate wakes during promptAsync gate hold (#4256, #4019)
In v4.1.0+, users observed duplicate assistant streams rendering the same
content in two languages simultaneously (e.g. Chinese + English), most often
at the end of a turn.

Root cause: ParentWakeNotifier.requeueWake() unconditionally requeued ANY
wake that arrived during the background-agent-parent-wake post-dispatch
hold window. When a duplicate completion edge fired during that hold, the
same wake was replayed after the hold expired, triggering a second prompt
dispatch and a parallel assistant stream.

The fix compares the new wake against dispatchedParentWakes.get(sessionID)
and drops identical wakes during the gate hold, while preserving the existing
requeue behavior for genuinely-new wakes and failed-dispatch retries.

Regression test added in given/when/then style covering the duplicate-during-
hold scenario (TDD red-then-green).

Fixes #4256
Fixes #4019
2026-05-22 20:40:37 +09:00
SpencerJung ec9997b7a6 fix(background-agent): keep cleanup error listener active
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-22 17:12:14 +09:00
YeonGyu-Kim bc0da0fad3 test: fix prometheus-prompt syntax + sync display name casing to lowercase
- prometheus-prompt.test.ts: close missing }) on the OpenSpec expanded
  commands describe block (introduced by d66b6bcbf, parse error).
- agent-sort-shim/agent-config-integration/continuation-injection/
  unstable-agent-babysitter/subagent-resolver/sync-executor/
  resolve-caller-team-lead tests: expect 'Sisyphus - ultraworker'
  (lowercase) to match production after cd39f8858, which lowercased the
  display name to dodge a TUI ZWSP rendering glitch. Legacy uppercase
  inputs that exercise the normalization path are preserved.
- sync-executor.ts + resolve-caller-team-lead.ts: route legacy display
  name inputs through normalizeAgentForPrompt so prompt agent names and
  caller team lead lookups produce the canonical lowercase form.
2026-05-22 00:07:46 +09:00
MoerAI bac9a6057a fix(opencode-skill-loader): align getSkillByName with short-name matching (fixes #4183)
PR #4146 fixed the async resolvers (resolveSkillContentAsync, resolveMultipleSkillsAsync) to support unambiguous short-name skill lookups by routing through matchSkillByName. But the public getSkillByName API (exported from src/features/opencode-skill-loader/) was left on the old skills.find(s => s.name === name) lookup, so any external caller asking for 'systematic-debugging' on a 'superpowers/systematic-debugging' skill silently gets undefined.

Wire getSkillByName through the same matchSkillByName helper so the public API matches the async resolution semantics:
- Exact full-name lookup (case-insensitive) is preferred.
- Unambiguous short-name lookup falls back to the unique namespaced match.
- Ambiguous short-name (>=2 namespaces share the same short tail) returns undefined, mirroring matchSkillByName.

Regression tests added to src/features/opencode-skill-loader/loader.test.ts under a new 'getSkillByName' describe block:
- exact full-name returns the skill
- namespaced skill resolves by its unique short name
- ambiguous short name returns undefined

Verification: 3/3 new cases pass, 129/129 full src/features/opencode-skill-loader tests pass (was 126/126 pre-fix), bun run typecheck clean.
2026-05-21 18:45:00 +09:00
YeonGyu-Kim dbfde0b056 fix(background-agent): ignore metadata stream output 2026-05-21 16:12:53 +09:00
YeonGyu-Kim 282010f97d fix(background-agent): gate stale timeout on abort success 2026-05-21 15:59:50 +09:00
YeonGyu-Kim 6d15ab86ab fix(background-agent): fail cancellation when abort fails 2026-05-21 15:50:28 +09:00
YeonGyu-Kim bd1a6e3d3b fix(background-agent): forward session stream activity 2026-05-21 15:49:58 +09:00
YeonGyu-Kim 0bf8a9df25 fix(background-agent): fail abort on SDK errors
Treat resolved abort responses with a non-null error payload the same as rejected aborts. This prevents stale-timeout cancellation bookkeeping from reporting success when the child session was not actually aborted.

Plan: .omo/plans/subagent-timeout-active-output.md
2026-05-21 15:23:52 +09:00
YeonGyu-Kim b68af25e41 fix(background-agent): track session.next activity
Convert OpenCode v2 session.next stream events into the existing message part activity path so child sessions that are still producing text, reasoning, or tool output refresh lastUpdate before stale polling runs.

This keeps the timeout poller from cancelling active subagents and preserves tool-call progress for session.next.tool.called events.

Plan: .omo/plans/subagent-timeout-active-output.md
2026-05-21 15:23:26 +09:00
YeonGyu-Kim 0feb125079 fix(background-agent): preserve missed polls on lookup errors 2026-05-21 13:13:14 +09:00
YeonGyu-Kim 3d40264456 Merge pull request #4228 from code-yeongyu/fix/delegate-stale-activity
Fix delegate stale timeout activity checks
2026-05-21 12:59:11 +09:00
YeonGyu-Kim deb13d8e86 Merge pull request #3241 from cpkt9762/fix/configurable-task-cleanup-delay
feat(background-task): make taskCleanupDelayMs configurable
2026-05-21 12:58:54 +09:00
YeonGyu-Kim 6678c2ae04 Merge pull request #3884 from leeyazhou/i18n
feat(i18n): add toast i18n with en/zh locale and plugin config support
2026-05-21 12:58:45 +09:00
YeonGyu-Kim e4049b7ab3 Merge pull request #4222 from andomeder/wip/pr1-skip-disconnected-explicit-provider-fallbacks
fix(background-agent): skip disconnected explicit-provider fallbacks
2026-05-21 12:57:58 +09:00
YeonGyu-Kim f7ceb03efe refactor(packages): extract boulder-state package 2026-05-21 12:49:33 +09:00
YeonGyu-Kim a5c1d71001 refactor(packages): extract utils package 2026-05-21 12:48:43 +09:00
YeonGyu-Kim 6e6f300c7d fix(background-agent): defer stale cancel on activity lookup errors 2026-05-21 12:43:51 +09:00
YeonGyu-Kim 927cc84fa5 fix(background-agent): refresh stale checks from session activity 2026-05-21 12:32:43 +09:00
YeonGyu-Kim 0ad4d974f1 fix(background-agent): preserve parent activity across idle events
Cubic caught that clearing recent parent activity on session.idle could reopen the stale-idle race. Keep the fresh activity marker until its normal expiry so background completions still defer while the parent turn is actively reasoning.

Red: parent idle after fresh reasoning delta dispatched an unexpected parent wake. Green: focused parent-wake regression suite passes.
2026-05-21 12:07:40 +09:00
YeonGyu-Kim a8201726ef fix(background-agent): defer parent wakes during active turns
Record fresh parent session message activity before parent-wake flushing so stale idle status cannot dispatch a background completion into a live reasoning turn.

Add regression coverage for the Discord 4.2.3/OpenCode 1.15.5 duplicate-branch repro shape where a parent reasoning delta arrives before the background all-complete wake.

Refs #4212

Refs #4019

Refs #3774

Plan: plans/background-notification-active-turn-queue.md
2026-05-21 11:50:30 +09:00
William Obino 5a965fb44f fix(background-agent): skip disconnected explicit-provider fallbacks 2026-05-21 02:55:18 +03:00
YeonGyu-Kim 2a4f5f2877 Merge pull request #2958 from kui123456789/fix/context-injector-prt-prefix
fix(context-injector): prefix synthetic part ids with prt_
2026-05-21 00:56:26 +09:00
YeonGyu-Kim ace15a6afe Merge pull request #3785 from Biemmmmm/fix/resolve-plugin-root-in-commands
fix: resolve ${CLAUDE_PLUGIN_ROOT} in plugin commands, agents, and skills
2026-05-21 00:48:33 +09:00
YeonGyu-Kim d0719ff7b7 Merge pull request #3875 from jollyxenon/fix/3846-opencode-config-dir-additive
fix(config): align OPENCODE_CONFIG_DIR with additive OpenCode semantics
2026-05-21 00:48:00 +09:00
YeonGyu-Kim 6dcb2afd41 Merge pull request #3838 from NICxKMS/fix/team-mode-windows-atomic-write
fix(team-mode): sync atomic writes through writable handle
2026-05-21 00:46:24 +09:00
YeonGyu-Kim 2185babd28 Merge pull request #3936 from wjiuxing/fix/flaky-spawner-test-polling
fix: replace brittle setTimeout(50) with polling waitForCondition in spawner tests
2026-05-21 00:46:06 +09:00