Commit Graph

30 Commits

Author SHA1 Message Date
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 90e6e0cdce feat(openclaw): integrate typed tmux runner for external dispatch 2026-05-06 14:18:08 +09:00
YeonGyu-Kim 3ddc757b15 fix(bun-spawn-shim): eliminate globalThis.Bun top-level destructures for Electron/Node compat
Root cause: bun build --target bun inlines top-level
  var { spawn } = globalThis.Bun;
for every file that contains 'import { spawn } from "bun"'. On Node/Electron
where globalThis.Bun is undefined, this crashes with
  Cannot destructure property 'spawn' of 'globalThis.Bun' as it is undefined.
26 source files had this import; the bundled output had 25 top-level destructures.

Fix:
- Add src/shared/bun-spawn-shim.ts: a thin wrapper that
  - delegates to Bun.spawn/spawnSync when globalThis.Bun is present (real Bun)
  - falls back to static ESM imports of node:child_process otherwise
  - uses static 'import { spawn } from "node:child_process"' so Bun bundler
    does NOT emit any globalThis.Bun destructures for this module
- Replace all 26 'from "bun"' spawn/spawnSync imports with relative paths to shim
- Replace 4 direct Bun.spawn() call sites with shim's spawn()
- Remove src/electron-compat.ts and script/prepend-electron-shim.ts (no longer needed)
- Update src/electron-compat.test.ts to assert 0 top-level globalThis.Bun destructures

Verification: grep -c '} = globalThis.Bun;' dist/index.js → 0 (was 25)
All 5921 tests pass (1 pre-existing timeout failure unrelated to this change).

Fixes #3797
2026-05-05 22:41:45 +09:00
YeonGyu-Kim 5759a9c503 docs(agents): refresh AGENTS.md hierarchy via /init-deep
Updated root + 14 core subdirectory AGENTS.md files to reflect current
state (commit 2892ca4a on dev). Added 4 new AGENTS.md files for gap
directories: hooks/comment-checker (AI slop blocker), features/claude-
code-plugin-loader (CC compat layer), features/claude-code-mcp-loader
(tier 2 MCP loader), cli/doctor (health diagnostics with 25 check files).
2026-04-18 01:21:20 +09:00
YeonGyu-Kim 44ebf4b809 Merge pull request #3343 from code-yeongyu/refactor/ultrawork-cleanup-pass
refactor: trim duplicate logic and dead internal exports
2026-04-11 23:12:16 +09:00
YeonGyu-Kim a2ae3de31a refactor(openclaw): extract gateway url validator
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 22:49:15 +09:00
YeonGyu-Kim 21822ba29f test(openclaw): cover shared gateway url validation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 22:49:10 +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 f95e7a6c6b refactor(openclaw): reuse shared gateway url validation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 22:29:14 +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 2083cb0710 feat(agents): add centralized GPT apply_patch permission guard
Extract hardcoded GPT apply_patch permission logic into a reusable module
to ensure consistent behavior across all agents. This prevents GPT models
from using the unreliable apply_patch tool while allowing other models.

- Add gpt-apply-patch-guard.ts with GPT_APPLY_PATCH_GUIDANCE and getGptApplyPatchPermission
- Update Hephaestus agent to use centralized permission logic
- Update Sisyphus-Junior agent to use centralized permission logic
- Update all GPT prompt builders to reference shared guidance constant

🤖 Generated with assistance of OhMyOpenCode
2026-04-10 10:47:27 +09:00
YeonGyu-Kim 58be69114f docs: update AGENTS.md hierarchy with openclaw, runtime-fallback, skill-mcp-manager
- Add src/openclaw/AGENTS.md: bidirectional Discord/Telegram/webhook integration
- Add src/hooks/runtime-fallback/AGENTS.md: reactive provider error recovery
- Add src/features/skill-mcp-manager/AGENTS.md: tier-3 MCP lifecycle
- Update root AGENTS.md: refresh commit hash, add openclaw/IntentGate/Hashline refs
- Fix src/features/AGENTS.md: skill-mcp-manager file count 14→18, complexity MEDIUM→HIGH

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-09 15:14:40 +09:00
GeonWoo Jeon (Jay) f82cc81c33 fix(ci): isolate discord reply listener test 2026-04-09 12:09:09 +09:00
GeonWoo Jeon (Jay) 20ee955030 fix(openclaw): stop stale listeners during initialization 2026-04-07 22:52:09 +09:00
GeonWoo Jeon (Jay) ed4617ec84 fix(openclaw): stabilize reply polling and tmux injection 2026-04-07 22:52:09 +09:00
GeonWoo Jeon (Jay) 92b59b1afd fix(openclaw): harden reply listener process lifecycle 2026-04-07 22:52:09 +09:00
GeonWoo Jeon (Jay) 6c2bed2f58 fix(openclaw): split reply listener state and startup flow 2026-04-07 22:52:09 +09:00
GeonWoo Jeon (Jay) efde63f733 fix(openclaw): register reply correlation from runtime dispatch 2026-04-07 22:52:09 +09:00
GeonWoo Jeon (Jay) 4241227227 fix(openclaw): parse wake metadata from gateway responses 2026-04-07 22:52:09 +09:00
YeonGyu-Kim dc695e8776 refactor(cli,mcp,openclaw): remove AI slop from code comments 2026-04-03 21:42:12 +09:00
YeonGyu-Kim 366ebb33c4 feat(openclaw): improve dispatcher and integration
🤖 Generated with assistance of OhMyOpenCode
2026-03-31 17:33:45 -07:00
YeonGyu-Kim eec268ee42 fix: use find() instead of calls[0] in wakeGateway test to handle background fetch calls 2026-03-21 18:01:39 +09:00
YeonGyu-Kim 399796cbe4 fix(openclaw): add comment clarifying proc.exited race condition avoidance
cubic identified potential race condition where Bun's proc.exitCode
may be null immediately after stdout closes. Added clarifying
comment that await proc.exited ensures exitCode is set before
checking.

fixes: cubic review on PR #2620
2026-03-17 17:14:52 +09:00
YeonGyu-Kim 82e25c845b fix: address cubic re-review — remove non-existent session.stop event, fix env var fallback test 2026-03-17 17:00:18 +09:00
YeonGyu-Kim c644930753 Fix OpenClaw review issues 2026-03-16 22:28:54 +09:00
YeonGyu-Kim b79df5e018 feat: port OpenClaw bidirectional integration from omx
Ports the complete OpenClaw integration system from oh-my-codex:

Outbound (opencode→OpenClaw):
- wakeOpenClaw() fire-and-forget gateway notifications
- HTTP and command gateway dispatchers
- Template variable interpolation
- Config from oh-my-opencode.jsonc (no env gate needed)

Inbound (OpenClaw→opencode):
- Reply listener daemon (Discord/Telegram polling)
- Session registry for message↔tmux pane correlation
- Tmux pane detection, content capture, and text injection
- Input sanitization and rate limiting
- Pane verification before injection

Files:
- src/openclaw/ (types, config, dispatcher, index, reply-listener, session-registry, tmux, daemon)
- src/config/schema/openclaw.ts (Zod v4 schema)
- src/hooks/openclaw.ts (session hook)
- Tests: 12 pass (config + dispatcher)
2026-03-16 21:55:10 +09:00
YeonGyu-Kim 239da8b02a Revert "Merge pull request #2607 from code-yeongyu/feat/openclaw-integration"
This reverts commit 8213534e87, reversing
changes made to 84fb1113f1.
2026-03-16 21:09:08 +09:00
YeonGyu-Kim 17244e2c84 Revert "Merge pull request #2609 from code-yeongyu/fix/rename-omx-to-omo-env"
This reverts commit 4759dfb654, reversing
changes made to 8213534e87.
2026-03-16 21:09:08 +09:00
YeonGyu-Kim 2c8813e95d fix: rename OMX_OPENCLAW env vars to OMO_OPENCLAW
Renames all environment variable gates from the old oh-my-codex (OMX) prefix
to the correct oh-my-openagent (OMO) prefix:

- OMX_OPENCLAW -> OMO_OPENCLAW
- OMX_OPENCLAW_COMMAND -> OMO_OPENCLAW_COMMAND
- OMX_OPENCLAW_DEBUG -> OMO_OPENCLAW_DEBUG
- OMX_OPENCLAW_COMMAND_TIMEOUT_MS -> OMO_OPENCLAW_COMMAND_TIMEOUT_MS

Adds TDD tests verifying:
- OMO_OPENCLAW=1 is required for activation
- Old OMX_OPENCLAW env var is not accepted
2026-03-16 18:45:34 +09:00
YeonGyu-Kim 03b346ba51 feat: implement OpenClaw integration
Ports the OMX OpenClaw module into oh-my-openagent as a first-class integration.
This integration allows forwarding internal events (session lifecycle, tool execution) to external gateways (HTTP or command-based).

- Added `src/openclaw` directory with implementation:
  - `dispatcher.ts`: Handles HTTP/Command dispatching with interpolation
  - `types.ts`: TypeScript definitions
  - `client.ts`: Main entry point `wakeOpenClaw`
  - `index.ts`: Public API
- Added `src/config/schema/openclaw.ts` for Zod schema validation
- Updated `src/config/schema/oh-my-opencode-config.ts` to include `openclaw` config
- Added `src/hooks/openclaw-sender/index.ts` to listen for events
- Registered the hook in `src/plugin/hooks/create-session-hooks.ts`
- Added unit tests in `src/openclaw/__tests__`

Events handled:
- `session-start` (via `session.created`)
- `session-end` (via `session.deleted`)
- `session-idle` (via `session.idle`)
- `ask-user-question` (via `tool.execute.before` for `ask_user_question`)
- `stop` (via `tool.execute.before` for `stop-continuation` command)
2026-03-16 17:21:56 +09:00