Commit Graph

22 Commits

Author SHA1 Message Date
YeonGyu-Kim ecb87608e6 fix: wire host config.skills.paths into command skill discovery
Mirrors the agent-config-handler change: command-config-handler now also discovers skills from host config.skills.paths set by other plugins, making them available as slash commands.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 13:43:56 +09:00
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 2258c009e9 feat(plugin-handlers): wire team-mode into agent, command and tool config handlers 2026-05-06 14:19:39 +09:00
YeonGyu-Kim 15c8d469bc refactor(command-config): use getAgentListDisplayName for consistent naming
Update command config handler and tests to use getAgentListDisplayName

for proper agent name resolution in command configurations.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-11 22:01:42 +09:00
YeonGyu-Kim 9532440cb2 fix(plugin-handlers): remove ZWSP prefixes from API-facing agent paths 2026-04-10 18:47:18 +09:00
YeonGyu-Kim 4f88e0f4e1 fix(agents): restore canonical core agent ordering
Remap the core agent keys, default agent, and command routing back to\nlist display names so OpenCode's name-based sorting keeps the\ncanonical Sisyphus -> Hephaestus -> Prometheus -> Atlas order.\n\nAlso teach tool config lookups to resolve the prefixed list keys and\nadd regression tests that exercise the real ordering and routing path.
2026-04-09 12:50:05 +09:00
YeonGyu-Kim 47283f9238 fix(agents): remove ZWSP prefixes from config.agent keys (#3238)
Agent names in the config.agent object (which becomes the /agent API
response) contained invisible Zero-Width Space (U+200B) characters
baked in by getAgentListDisplayName(). These ZWSP prefixes were used
for TUI sort ordering, but they leaked into the public API surface.

Impact: any prompt_async consumer that discovered agent names via the
/agent endpoint and passed them back to prompt_async without manual
ZWSP stripping got silent message drops — the agent name didn't match.
hy-pony's feishu-bridge integration went dark after upgrading to 3.16.0
with no error, no warning, and no indication that invisible Unicode
characters in agent names were the cause.

Fix: switch all four callsites from getAgentListDisplayName() (which
prepends \u200B×N) to getAgentDisplayName() (clean names):

- agent-key-remapper.ts: config keys → display names (was the primary
  injection point)
- agent-priority-order.ts: CORE_AGENT_ORDER lookup (must agree with
  the keys emitted by the remapper)
- command-config-handler.ts: command agent field normalization
- tool-config-handler.ts: agent config lookup (simplified fallback
  chain since the primary lookup is now clean)

Sort ordering is preserved by:
1. JS object insertion order from reorderAgentsByPriority()
2. The injected `order` field (1-4) added by injectOrderField()

getAgentListDisplayName() is marked @deprecated with a link to #3238.
AGENT_LIST_SORT_PREFIXES and stripAgentListSortPrefix() are kept for
any internal callers that strip prefixes from legacy data.

Closes #3238
2026-04-08 22:51:59 +09:00
YeonGyu-Kim 06b825dd74 fix(start-work): reuse registered opencode agent names 2026-04-08 16:18:26 +09:00
YeonGyu-Kim 24629643f0 fix(start-work): use canonical display name for command routing 2026-04-08 16:09:09 +09:00
YeonGyu-Kim 8925ec3a16 fix(start-work): align command routing with exported agent keys 2026-04-08 16:00:47 +09:00
YeonGyu-Kim cd95172e42 fix(start-work): keep native command agents on config keys 2026-04-08 15:58:02 +09:00
YeonGyu-Kim 3724093618 fix(zwsp): strip zero-width chars from agent headers in command-config-handler
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-08 13:01:43 +09:00
YeonGyu-Kim 66cc823ff3 refactor(plugin): remove AI slop and clean verbose comments 2026-04-03 21:42:14 +09:00
YeonGyu-Kim 51d9685571 fix(start-work): use Atlas list key in command config 2026-04-01 17:45:16 -07:00
YeonGyu-Kim 724d21b3cc fix(start-work): restore atlas-first slash discovery
Static slash-command discovery runs before agent registration, so /start-work regressed to Sisyphus even though config-time wiring still needed Atlas-aware fallback. Split builtin command resolution so discovery stays Atlas-first while command config remains availability-aware.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-01 17:32:46 -07:00
codivedev 38347a396e fix: address review comments - remove duplicates and respect skills config 2026-03-27 13:49:58 +01:00
codivedev 885d3a2462 fix: detect and warn about opencode-skills conflict 2026-03-27 13:40:00 +01:00
YeonGyu-Kim 12a4318439 fix(commands): load .agents skills into command config
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-26 12:15:47 +09:00
YeonGyu-Kim cb601ddd77 fix: resolve category delegation and command routing with display name agent keys
Category-based delegation (task(category='quick')) was broken because
SISYPHUS_JUNIOR_AGENT sent 'sisyphus-junior' to session.prompt but
config.agent keys are now display names ('Sisyphus-Junior').

- Use getAgentDisplayName() for SISYPHUS_JUNIOR_AGENT constant
- Replace hardcoded 'sisyphus-junior' strings in tools.ts with constant
- Update background-output local constants to use display names
- Add remapCommandAgentFields() to translate command agent fields
- Add raw-key fallback in tool-config-handler agentByKey()
2026-02-16 21:32:33 +09:00
Willy f9ea9a4ee9 fix(project): use directory param instead of process.cwd() for agents, commands, and slash commands
Extends the process.cwd() fix to cover all project-level loaders. In the desktop app, process.cwd() points to the app installation directory instead of the project directory, causing project-level agents, commands, and slash commands to not be discovered. Each function now accepts an optional directory parameter (defaulting to process.cwd() for backward compatibility) and callers pass ctx.directory from the plugin context.
2026-02-13 11:09:35 +08:00
YeonGyu-Kim 0001bc87c2 feat(skills): load config sources in runtime discovery 2026-02-13 11:08:46 +09:00
YeonGyu-Kim 598a4389d1 refactor(core): split index.ts and config-handler.ts into focused modules
Main entry point:
- create-hooks.ts, create-tools.ts, create-managers.ts
- plugin-interface.ts: plugin interface types
- plugin/ directory: plugin lifecycle modules

Config handler:
- agent-config-handler.ts, command-config-handler.ts
- tool-config-handler.ts, mcp-config-handler.ts
- provider-config-handler.ts, category-config-resolver.ts
- agent-priority-order.ts, prometheus-agent-config-builder.ts
- plugin-components-loader.ts
2026-02-08 16:25:25 +09:00