Commit Graph

147 Commits

Author SHA1 Message Date
YeonGyu-Kim 6c0252fae4 Merge pull request #3742 from mrosnerr/fix/schema-preserve-custom-agent-overrides
fix(schema): preserve custom agent overrides
2026-05-21 15:14:04 +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 c5f8fd4060 Merge pull request #4031 from PeterPonyu/feat/config-disabled-providers
feat(config): add disabled_providers schema + helper
2026-05-21 12:58:42 +09:00
YeonGyu-Kim 9cca6848c9 Merge pull request #4081 from PeterPonyu/feat/4004-agent-display-name-i18n
feat(agents): support per-agent displayName for i18n (#4004)
2026-05-21 12:58:21 +09:00
YeonGyu-Kim acedacc5e7 Merge pull request #4084 from pizzav-xyz/feature/keyword-detector-enabled-expansions
feat(keyword-detector): add enabled_expansions config for allowlist control
2026-05-21 12:58:18 +09:00
YeonGyu-Kim a7401a34ac Merge pull request #4157 from ririnto/docs/config-reference-alignment
docs: align config reference with implementation
2026-05-21 12:58:11 +09:00
YeonGyu-Kim b40426ca1b Merge pull request #4190 from herjarsa/feat/default-mode
feat(default-mode): auto-activate ultrawork and ralph loop without commands
2026-05-21 12:58:04 +09:00
heunghingwan 73b5a7eb0e Add plan format validator hook to detect malformed task labels
- Strengthen Prometheus plan template with FORMAT constraint
- Add task label format check to Oracle phase-2 (N/6 → N/7)
- Add format checks to self-review checklist
- New plan-format-validator hook: compares raw checkbox count
  against getPlanProgress() after plan writes, warns agent when
  labels are malformed (0/0 or partial skip scenarios)
2026-05-21 05:17:54 +08:00
YeonGyu-Kim 5eabeb80f9 Merge pull request #4082 from PeterPonyu/fix/3685-notepad-no-write-fallback
fix(notepad-guard): refuse Write tool for .sisyphus/notepads files (#3685)
2026-05-21 00:37:27 +09:00
herjarsa e5463e2db7 feat(default-mode): auto-activate ultrawork and ralph loop without commands
Add new `default_mode` config section with two boolean fields:
- `ultrawork`: Auto-inject ultrawork mode prompt on main session start
  without requiring the "ultrawork"/"ulw" keyword. Wired through the
  keyword-detector hook — injects once per session, respects existing
  guards (non-OMO agents, planner agents, subagent sessions).
- `ralph_loop`: Auto-start ralph loop on first main session message
  without requiring /ralph-loop or /ulw-loop commands. When ultrawork
  is also enabled, the loop starts in ultrawork mode.

Usage:
  ```jsonc
  {
    "default_mode": {
      "ultrawork": true,    // Always get ultrawork prompt on start
      "ralph_loop": true    // Auto-start ralph loop
    }
  }
  ```

Files: 7 modified/added, ~65 LOC added.
2026-05-19 18:11:37 +02:00
leeyazhou 9dc9d77904 feat(i18n): add toast i18n with en/zh locale and plugin config support
- Add src/locales/ with en baseline and zh overrides (Partial<Record> fallback)
- Add src/shared/i18n.ts with initI18n/t/setLocale/getLocale (LANG env auto-detect)
- Add I18nConfigSchema with locale field to plugin config
- Internationalize 13 hardcoded strings in task-toast-manager
- Add 18 unit tests for i18n module
- Pin manager tests to en locale for determinism
2026-05-19 14:31:13 +08:00
ririnto 8b40d0af2a docs: align config reference with implementation 2026-05-18 21:39:10 +09:00
ZeyuFu 572c3c248e fix(notepad-guard): refuse Write tool for .sisyphus/notepads files (#3685)
Adds a new `notepad-write-guard` hook that intercepts Write tool calls
whose target path matches `**/.sisyphus/notepads/**` and throws an
actionable error instead of allowing the write to proceed.

Without this guard, an agent that hits an Edit hash-mismatch failure
could silently fall back to Write, destroying the entire history of an
append-only notepad file (decisions.md, issues.md, etc.).  The file
carries an explicit "NEVER overwrite" warning that the agent ignores
under context pressure.

The guard is path-based so it works regardless of plan name or nesting
depth.  Non-notepad `.sisyphus/**` paths (e.g. plan files) are
unaffected.  The hook is wired into `create-tool-guard-hooks` under the
hook name `notepad-write-guard` and follows the same safeCreateHook +
HookName schema pattern as every other tool-guard hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 06:52:43 -04:00
ZeyuFu 7bc92bcd25 feat(agents): support per-agent displayName for i18n (#4004)
Add optional `displayName` field to AgentOverrideConfigSchema (next to
the existing `color` field) so users can specify localized agent names
in oh-my-openagent.json:

  { "agents": { "sisyphus": { "displayName": "总指挥" } } }

When set, the override takes precedence everywhere
AGENT_DISPLAY_NAMES[agentName] is used — TUI agent selector, the
agent list key, and the internal `name` field. When not set, behavior
is identical to before (hardcoded English names from AGENT_DISPLAY_NAMES).

Implementation touches:
- AgentOverrideConfigSchema: adds displayName?: z.string().optional()
- getAgentDisplayName / getAgentListDisplayName: accept optional overrides
  map and check displayName before the hardcoded table
- remapAgentKeysToDisplayNames: forwards overrides map to name resolution
- agent-config-handler: passes pluginConfig.agents as the overrides map

Backward compatible — existing configs without displayName continue to
work unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 06:52:14 -04:00
YeonGyu-Kim 36e373cdbb feat(workspace): point planning guardrails at omo 2026-05-16 17:41:35 +09:00
pizzav-xyz f152569ed4 feat(keyword-detector): add enabled_expansions config for allowlist control
Add optional enabled_expansions field to keyword_detector config schema.
When set, acts as an allowlist - only those expansion types fire.
Empty array disables all expansions. Absent field keeps all enabled (backward-compatible).
Also supports coexistence with disabled_keywords denylist for fine-grained control.

- src/config/schema/keyword-detector.ts: add enabled_expansions field
- src/hooks/keyword-detector/detector.ts: apply allowlist filter in detectKeywordsWithType
- src/hooks/keyword-detector/hook.ts: pass enabled_expansions from config
- src/hooks/keyword-detector/index.test.ts: add 4 tests for enabled_expansions behavior
- assets/oh-my-opencode.schema.json: regenerate schema
2026-05-16 02:01:29 +02:00
PeterPonyu e8a640883a feat(config): add disabled_providers schema + helper
Adds an opt-in `disabled_providers` config field plus the `shared/disabled-providers`
helper (`isProviderDisabled`, `filterDisabledProviderModels`, `applyDisabledProviders`)
that the plugin-config layer applies to resolved providers.

The routing changes in team-mode (team-runtime, tools/lifecycle, plugin/tool-registry)
are NOT in this PR — those are entangled with the `MemberSelectionMode` /
`ShutdownActor` refactors from the closed PR #3871 and need their own extraction
once those refactors land independently. This PR isolates the parts that are
cleanly independent: schema, helper, and config-layer wiring.

Companion to #4024 (live-tail tailer), both extracted from the closed PR #3871.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 21:40:02 -04:00
YeonGyu-Kim 3a738e7047 Merge remote-tracking branch 'origin/dev' into feature/configurable-agent-ordering 2026-05-08 16:08:26 +09:00
YeonGyu-Kim 9522dd4ca4 feat(config): add configurable agent ordering 2026-05-08 16:08:18 +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 9b87fd5019 Merge pull request #3744 from Arcadi4/dev
Allow "max" option for "reasoningEffort" field in config schema
2026-05-06 17:14:57 +09:00
YeonGyu-Kim 5c67482038 feat(keyword-detector): add hyperplan-ultrawork combo + tuple refactor
Adjacent "hpp ulw" or "ulw hpp" (8 form combinations: short/long, both
orders) triggers a fused mode that suppresses the standalone ultrawork
and hyperplan banners and toasts in favor of one combo banner. The
combo banner explicitly preserves hyperplan's mandatory adversarial
workflow contract (do NOT improvise, do NOT skip rounds) instead of
silently downgrading it.

Suppression runs as a named pipeline step (suppressComboStandalones)
immediately after detection and before all consumers (planner filter,
session filters, toasts, message injection), so standalone toast checks
naturally see the already-suppressed list. Combo is allowed in non-main
sessions like ultrawork, filtered for planner agents like both
standalones, and blocked in subagent sessions via the existing gate.

disabled_keywords uses the intersection rule: disabling either
"ultrawork" or "hyperplan" also disables the combo, so no flavored
content leaks via the combo embedding when either base keyword is
disabled.

Includes a same-PR refactor of KEYWORD_DETECTORS from {pattern, message}
to {type, pattern, message} tuple shape, dropping the parallel hardcoded
types array in detector.ts that previously coupled type assignment to
registry index. Future detector additions can no longer silently corrupt
DetectedKeyword.type via reorder or insertion.

10 behavioral contract tests in hyperplan-ultrawork.test.ts cover both
trigger orders, non-adjacent rejection, suppression of injection and
toast, intersection-rule disable behavior, session/agent policy, and
ultrawork variant routing through the combo. The pre-existing combined
"ultrawork hyperplan" assertion in hyperplan.test.ts is removed in
favor of the new file.

Plan distilled from a hyperplan adversarial review (5 members,
3 rounds: skeptic, validator, researcher, architect, creative).
2026-05-06 14:20:50 +09:00
YeonGyu-Kim 4af7d62f78 feat(config): add hyperplan to keyword detector type schema
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 585ad6d8d5 feat(config): add hyperplan to builtin command schema
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 ec121a730f feat(config): add team-mode configuration schema and merge support 2026-05-06 14:14:15 +09:00
4rcadia f49afe7b91 refactor(agents): Add "max" to all codebase reasoning enums accordingly 2026-04-30 23:57:58 -04:00
mrosnerr bcc554bb6e fix(schema): preserve custom agent overrides via catchall
AgentOverridesSchema silently strips custom agent keys during Zod
parsing because only 14 built-in names are explicitly defined. Add
.catchall(AgentOverrideConfigSchema.optional()) so user-defined agent
configs survive validation and reach downstream consumers like
resolveModelAndFallbackChain().

Fixes #3229.
2026-04-30 17:14:35 -04:00
YeonGyu-Kim 56be458ede fix(config): remove obsolete maxDescendants config 2026-04-16 23:13:34 +09:00
YeonGyu-Kim e5d3fe96c4 fix(agents): address all PR #2299 code review findings
Blocking fixes:
- B1: Return empty restrictions for unknown/custom agents instead of
  EXPLORATION_AGENT_DENYLIST, allowing custom agents full tool access
- B2: Use Object.create(null) consistently across all 5 agent-loading
  result objects to prevent prototype pollution
- B3: Add code comment documenting custom agent bash access trust model
- B4: Mock getOpenCodeConfigDir in opencode-config-agents-reader tests
  to prevent global config dir leakage

Non-blocking fixes:
- N1: Use resolveAgentDefinitionPaths with project boundary enforcement
  in opencode-config-agents-reader for path containment
- N2: Add session-scoped 30s TTL cache to resolveCallableAgents to
  avoid redundant SDK IPC calls per tool invocation
- N3: Extract shared parseToolsConfig into src/shared/parse-tools-config.ts
  replacing 4 duplicated local implementations
- N4: Add .min(1) to AgentDefinitionPathSchema rejecting empty paths
- N5: Add resolve-agent-definition-paths.test.ts covering tilde expansion,
  relative paths, boundary enforcement, and null containmentDir
- N6: Validate agent mode against allowed values instead of bare type
  assertion in opencode-config-agents-reader
2026-04-15 10:58:16 +09:00
Brandon Webb fd28f7e668 feat(agents): add agent_definitions schema, eager path resolution, and JSON agent loader
Wave 1 of agent definitions enhancement (PR #2299):

Schema & Configuration:
- Add agent_definitions field to oh-my-opencode config schema
- Support list of file paths to .md or .json agent definition files
- Add to PARTIAL_STRING_ARRAY_KEYS for Set-union merge semantics
- Implement eager path resolution in loadPluginConfig() before merging

Path Resolution:
- Create resolve-agent-definition-paths.ts helper
- User-level paths resolve from ~/.config/opencode/ (no containment)
- Project-level paths resolve from project root (with containment check)
- Homedir expansion, absolute/relative path handling

JSON Agent Loader:
- Create parseJsonAgentFile() for .json/.jsonc agent definitions
- Validate required fields (name, prompt)
- Support tools as string (comma-separated) or array
- Map model via mapClaudeModelToOpenCode()
- Comprehensive test suite (7 test cases, all passing)

Type Extensions:
- Extend AgentScope: add 'definition-file' and 'opencode-config'
- Add AgentJsonDefinition interface for JSON agent schema

All automated checks passing:
- lsp_diagnostics clean on all changed files
- json-agent-loader.test.ts: 7/7 passing
- Full typecheck: zero new errors
- QA evidence saved to .sisyphus/evidence/
2026-04-15 10:57:54 +09:00
YeonGyu-Kim 21cad26c08 docs(config): remove redundant schema default comments
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-12 00:07:10 +09:00
cpkt9762 14c25cbbf5 feat(background-task): make taskCleanupDelayMs configurable
TASK_CLEANUP_DELAY_MS is the delay between a task reaching a terminal
state (completed/cancelled/errored) and its removal from the in-memory
task store. It is currently a hard-coded 10 minute constant, which is
too short for long-running background workflows: users routinely hit
'task not found' on background_output lookups when they inspect
results more than ~10 minutes after completion.

taskTtlMs (landed in #2825) already exposes the non-terminal task TTL
on BackgroundTaskConfigSchema. This PR mirrors that pattern for the
terminal-state cleanup delay:

- Add taskCleanupDelayMs: z.number().min(60000).optional() to
  BackgroundTaskConfigSchema with JSDoc matching taskTtlMs's style.
- BackgroundManager.scheduleCompletionRemoval() reads
  this.config?.taskCleanupDelayMs ?? TASK_CLEANUP_DELAY_MS, preserving
  the existing 10 min default for unconfigured users.
- Regenerate assets/oh-my-opencode.schema.json.

Default: 600000 ms (10 min, unchanged from current hard-coded value).
Minimum: 60000 ms (1 min).

bun run typecheck: clean.
bun test src/features/background-agent: 411/411 pass.
2026-04-08 21:45:01 +08:00
YeonGyu-Kim bd723b5163 fix(tests): repair test regressions from zod v3 downgrade
- Fix zod/v4 imports in background-task schema tests
- Remove ZWSP prefix from agent-key-remapper test (fixed in #3136)
- Use toMatchObject for openai-only catalog tests (fallback_models added by #3144)
- Replace z.toJSONSchema (zod v4) with zodToJsonSchema (zod v3 compat)
- Fix task-list.ts type narrowing for zod v3 inferred types
2026-04-06 14:43:19 +09:00
YeonGyu-Kim 8199adcb15 fix(config): allow disabling new built-in skills
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-04 15:37:43 +09:00
YeonGyu-Kim e0feb16dab refactor(shared,config): remove redundant null checks and AI slop from code comments 2026-04-03 19:39:55 +09:00
YeonGyu-Kim 57c973bac5 Revert tmux config default isolation to inline
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-03 17:11:01 +09:00
YeonGyu-Kim c78a9e640a Revert "Merge pull request #3047 from code-yeongyu/fix/p0-4-tmux-default-isolation"
This reverts commit 2d13e125bb, reversing
changes made to c45fc83caa.
2026-04-03 17:10:23 +09:00
YeonGyu-Kim 9fb9e15222 Revert tmux config default isolation to inline
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-03 17:06:22 +09:00
YeonGyu-Kim fba20f9f09 Merge pull request #3019 from code-yeongyu/fix/issue-2986-prometheus-fallback
fix(prometheus): respect fallback chain when no explicit model configured
2026-04-02 15:10:43 +09:00
YeonGyu-Kim 1b5114b256 Merge pull request #3017 from code-yeongyu/fix/issue-3014-tool-pair-validation
fix(hook): add tool_use/tool_result pair validator
2026-04-02 15:10:38 +09:00
YeonGyu-Kim e8c5727a22 fix(mcp): restrict env var expansion in MCP configs
Block sensitive env var interpolation in MCP config expansion so repo and plugin MCP definitions cannot exfiltrate secrets by default.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-02 14:55:01 +09:00
YeonGyu-Kim bc07c21e50 fix(test): rewrite prometheus tests to verify behavior not log messages 2026-04-02 13:54:52 +09:00
YeonGyu-Kim 2440ed9a6f fix(hook): add tool_use/tool_result pair validator to prevent API errors
Adds a defensive tool-pair-validator hook that runs as the final step in
the messages transform pipeline. When compaction or context-window recovery
removes user messages containing tool_result blocks without removing the
preceding assistant message with tool_use blocks, this validator detects
the mismatch and either:

1. Injects missing tool_result parts into the next user message, or
2. Creates a synthetic user message with placeholder tool_results

This prevents Anthropic API errors like 'tool_use ids found without
tool_result blocks immediately after'.

Fixes #3014
2026-04-02 13:31:48 +09:00
YeonGyu-Kim 92d70cff5b feat: add review-work and ai-slop-remover as built-in skills, add remove-ai-slops command
Embed user-level skills into the plugin's built-in system so they ship
with the product rather than requiring per-user configuration.

- review-work: 5-agent parallel post-implementation review orchestrator
- ai-slop-remover: per-file AI-generated code smell detector and remover
- /remove-ai-slops: command that orchestrates parallel ai-slop-remover runs
2026-03-31 17:22:34 -07:00
YeonGyu-Kim 51194e9434 Merge pull request #2919 from ryandielhenn/feat/config_tdd
Add Configurable TDD To Sisyphus Agent Schema
2026-03-29 18:55:21 -07:00
YeonGyu-Kim 44c6a2ad5c Merge pull request #2931 from sjawhar/feat/tmux-session-isolation
feat(tmux): add session isolation mode for subagent panes
2026-03-29 18:44:29 -07:00
YeonGyu-Kim 0f6c7a9ca0 fix(config): accept object-format fallback_models in Zod validation (fixes #2943)
FallbackModelsSchema now explicitly accepts string[], object[], and
mixed array formats, matching the JSON schema definition.

Verified: 15 config schema tests pass, typecheck clean
2026-03-30 10:35:06 +09:00
Sami Jawhar a3cc2d1c95 feat(tmux): add session isolation mode for subagent panes 2026-03-29 17:53:30 +00:00