Commit Graph

4469 Commits

Author SHA1 Message Date
YeonGyu-Kim a9886ccbb7 refactor(plugin): remove metadata assertions
Guard optional plugin metadata and pane identifiers before passing them to cleanup and warning paths.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 16:31:13 +09:00
YeonGyu-Kim 0a3d1875f7 refactor(tools): narrow optional values
Avoid non-null assertions in tool and doctor code by preserving narrowed locals through each use site.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 16:31:13 +09:00
YeonGyu-Kim d92e78c956 refactor(sdk): narrow response fallbacks
Replace unsafe unknown-array assertions with generic fallback types and explicit todo status narrowing.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 16:31:13 +09:00
YeonGyu-Kim 4785767a0c refactor(interactive-bash): reuse tmux parser
Route interactive bash tracking through the existing tmux parser so session name narrowing is shared and type-safe.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 16:31:13 +09:00
YeonGyu-Kim 15e7330ff0 fix(team-mode): gate status injection by keyword 2026-05-15 15:35:35 +09:00
YeonGyu-Kim cd1c1a5921 fix(background-agent): avoid branched parent wakes 2026-05-15 14:39:55 +09:00
YeonGyu-Kim 9f6d0d2281 docs(agents-md): refresh hierarchical knowledge base for v4.1.2
- Bump root AGENTS.md header: 2026-05-14 → 2026-05-15, commit 5ffbe0e2453a740636, release v4.1.1 → v4.1.2
- Update file counts: 2034 (1337+697) → 2041 (1340+701), LOC ~292k → ~294k
- Fix STRUCTURE: openclaw lives at src/openclaw/ (not src/features/); list more accurate feature modules in the parenthetical
- Clarify interactive_bash gate: tmux binary on PATH via isInteractiveBashEnabled() (not 'tmux enabled')
- Fix docs/reference/features.md hook counts: Tool Guard 14→16, Total base 52→54, total with team-mode 59→61
- Bump 'Generated' date on all 43 subdir AGENTS.md files to 2026-05-15
- Preserve promptAsync injection cautions verbatim (per request)
2026-05-15 13:48:11 +09:00
YeonGyu-Kim c2aa180e7e fix(prompt-gate): pin duplicate prompt dispatches
Keep prompt reservations briefly after successful dispatch so rapid idle/message/error transitions cannot inject the same follow-up twice.

Route all production session prompt calls through the shared gate, restore skipped background resume state, release holds after abort/recovery paths, and preserve Ralph/ULW loop state when a dispatch is deferred.

Add regression coverage for session routing, static prompt route auditing, team-mode live messaging, model suggestion retries, call-omo-agent reuse, background parent wakes, runtime fallback, compaction recovery, Atlas, and Ralph/ULW loops.
2026-05-15 13:19:10 +09:00
YeonGyu-Kim 05189700fb fix(prompt-gate): hold reservations after dispatch 2026-05-15 12:55:56 +09:00
YeonGyu-Kim edf3e530d4 fix(hooks): gate sync injected prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 0b48f80569 fix(call-omo-agent): gate reused sync prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 439e72839b fix(runtime-fallback): gate retry prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 30adce9cad fix(prompt-gate): share message reservations 2026-05-15 12:55:56 +09:00
YeonGyu-Kim dd6271bbf4 fix(babysitter): gate reminder prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim a524754eca fix(todo-continuation): gate idle prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim b0b61182b4 fix(ralph-loop): gate continuation prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 960baf39bb fix(atlas): gate boulder continuation prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim b0a484b403 fix(session-recovery): gate resume prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim db28a32cff fix(recovery): gate compaction prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim c75f548863 fix(fallback): gate model retry prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim f1a62a9cd1 fix(team-mode): gate member wake prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 174cbd0fbd fix(background-agent): gate parent wake prompts 2026-05-15 12:55:56 +09:00
YeonGyu-Kim b2fdd728d0 fix(prompt-async): add session idle gate 2026-05-15 12:55:56 +09:00
YeonGyu-Kim 23dfe7eec2 fix(fallback): skip duplicate fallback re-arms
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 11:45:21 +09:00
YeonGyu-Kim b7482ea727 test(fallback): type chat output assertions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 11:28:18 +09:00
YeonGyu-Kim 26bb6231b6 fix(fallback): preserve provider-specific fallback retries
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 11:14:26 +09:00
YeonGyu-Kim 005d16dd96 fix(fallback): dedupe providerless fallback errors
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 11:14:26 +09:00
YeonGyu-Kim da339204bb fix(fallback): dedupe overlapping fallback continuations
Guard model fallback continuation dispatch so overlapping message.updated/session.error surfaces issue only one abort+promptAsync cycle for the same failed fallback.

Refs https://github.com/code-yeongyu/oh-my-openagent/issues/4019

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-15 11:14:26 +09:00
YeonGyu-Kim 8f90c1e92a fix(background-task): log missing output retry 2026-05-15 09:56:01 +09:00
YeonGyu-Kim d8652863a2 Merge remote-tracking branch 'origin/dev' into fix/background-output-bg-id-20260514 2026-05-14 19:11:44 +09:00
YeonGyu-Kim 268c89c945 fix(background-agent): coalesce rapid-fire idle parent notifications
When many background tasks complete in rapid succession while the parent
session is idle, each completion fired its own promptAsync call, stacking
N consecutive `<system-reminder>` user messages with no assistant turn
between. Hyperplan + many parallel explore subagents made this very
visible to the user.

Route the idle-path through the existing pendingParentWakes queue with a
100ms debounce window. Notifications arriving during the debounce join
the same batch, the 150ms settle window also coalesces newcomers, and a
single batched prompt fires to the parent. Busy-path semantics are
unchanged (still 1s retry).

Prior attempts (1c05c60dc, ea55c385b, a337635e3) all coalesced only the
busy-defer path, leaving the idle-immediate-send path uncoalesced.
2026-05-14 18:52:28 +09:00
YeonGyu-Kim 1ea192b3f4 fix(background-task): retry transient missing output tasks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-14 18:51:38 +09:00
YeonGyu-Kim b9beea1039 feat(team-mode): drive immediate teardown and recreate-to-reshape loop
Reframe the skill's Lifecycle section so the lead treats teams as
ephemeral, one-per-phase units. The moment a phase ends or the shape
no longer fits, call team_delete and spawn a fresh team. Restructure
through delete-then-create, never in place.

Also fixes a misframing in old step 5: team_shutdown_request is a
per-session self-shutdown signal, not a 'wind down the team' command.
team_delete is what tears the whole team down.
2026-05-14 18:22:30 +09:00
YeonGyu-Kim 9e6185266d fix(ralph-loop): guard compaction continuation ownership 2026-05-14 13:43:47 +09:00
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 ea55c385bb fix(background-agent): defer busy parent notifications 2026-05-14 00:45:36 +09:00
YeonGyu-Kim f9b95f9e3e Merge pull request #3993 from code-yeongyu/fix/non-interactive-env-windows-shell
fix(non-interactive-env): respect Windows command shell
2026-05-13 23:45:23 +09:00
YeonGyu-Kim 47d60a74d3 fix(non-interactive-env): honor Windows ComSpec shell
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-13 22:47:37 +09:00
YeonGyu-Kim 95cc9e2d28 [sisyphus-dev] fix(delegate-task): canonicalize agent dedup key to close hidden filter bypass
mergeWithClaudeCodeAgents deduplicated by raw agent.name.toLowerCase() while
matchesRequestedAgent strips invisible characters, the numeric sort prefix,
and wrapper characters via stripAgentListSortPrefix. A project or user agent
named with a zero-width prefix, quote wrappers, or a sort prefix survived as
a visible duplicate of the hidden native build or demoted plan agent and
matched subagent_type="build" or "plan", which let an OMO orchestrator reach
the hidden execution agent the previous filter was meant to block.

Apply the same canonicalization to the dedup key so visible aliases of hidden
server agents collapse onto the hidden entry instead of bypassing the filter.

Adds three regression tests covering ZWSP, quote-wrapper, and sort-prefix
bypass paths.

bun.lock: refresh platform optionalDependencies to 4.1.1 so frozen-lockfile
install succeeds in CI.
2026-05-13 20:31:17 +09:00
YeonGyu-Kim fef1d4530b fix(non-interactive-env): respect Windows command shell
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-13 20:07:46 +09:00
MoerAI 4bd81d2cdd fix(delegate-task): exclude hidden agents from task delegation discovery (fixes #3957)
OpenCode injects native execution agents like build (and a demoted plan in OMO mode) as { mode: 'subagent', hidden: true }. The dynamic agent discovery in subagent-discovery.ts only filtered by mode, so a hidden agent still resolved as a callable target via task(). This created a boundary leak: an OMO orchestrator (sisyphus, prometheus, etc.) could delegate work into the hidden native build/plan path instead of the OMO category/skill pipeline.

Add hidden?: boolean to AgentInfo, plumb it through mergeWithClaudeCodeAgents, and skip hidden agents in both findCallableAgentMatch and listCallableAgentNames so hidden natives are neither matched nor advertised in 'Available agents' error messages. The OpenCode SDK Agent type already exposes hidden?: boolean, so no schema work is required.

Verified by adding three regression tests in zauc-mocks-subagent-resolver/subagent-resolver.test.ts: hidden 'build' is rejected, hidden 'plan' is rejected, and hidden agents are excluded from the Available agents list. Full delegate-task suite (395 tests) and call-omo-agent suite (57 tests) pass; bun run typecheck is clean.
2026-05-13 19:37:54 +09:00
YeonGyu-Kim 61ba4e3b41 fix(ralph-loop): guard delayed start snapshots
Prevent delayed loop-start message counts from overwriting active Ralph Loop state after the loop has already advanced, so ULW completion can still enter Oracle verification instead of iterating forever.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-13 18:59:07 +09:00
YeonGyu-Kim 3b4d2431ee fix(hooks): guard stale idle prompts 2026-05-13 17:02:17 +09:00
YeonGyu-Kim a337635e3b fix(background-agent): defer active parent wakes 2026-05-13 17:02:17 +09:00
YeonGyu-Kim 36f51ddb16 fix(continuation): mark fallback resumes synthetic 2026-05-13 13:36:25 +09:00
YeonGyu-Kim 1189b96d42 fix(continuation): mark atlas resumes synthetic 2026-05-13 13:25:01 +09:00
YeonGyu-Kim 38b1433ff5 fix(continuation): mark resumes synthetic 2026-05-13 13:09:26 +09:00
YeonGyu-Kim 3f92264311 fix(interactive-bash): prohibit tmux kill-server 2026-05-13 13:07:13 +09:00
YeonGyu-Kim 75825eb9a6 fix(todo-description-override): add OpenCode schema contract for string priorities 2026-05-12 18:18:52 +09:00