Skip to content

CONFIG_DIRS uses singular names but opencode creates plural dirs (agent/ vs agents/) #67

Description

@mex7xx

Bug

opencode-synced v0.9.0 hardcodes singular directory names in CONFIG_DIRS, but opencode creates and uses plural directory names. This causes the sync to silently skip directories that contain user content.

Evidence

Source (src/sync/paths.ts:54)

const CONFIG_DIRS = ['agent', 'command', 'mode', 'tool', 'themes', 'plugin'];

Actual opencode directory layout

~/.config/opencode/
├── agent/        ← empty (synced, but nothing to sync)
├── agents/       ← has content (NOT synced) ← BUG
├── command/      ← doesn't exist
├── commands/     ← has content (NOT synced) ← BUG
├── plugin/       ← doesn't exist
├── plugins/      ← has content (NOT synced) ← BUG
├── skills/       ← has content (NOT synced in v0.9.0)

Observed behavior

When running opencode_sync push with default settings, the contents of agents/, commands/, plugins/, and skills/ are silently skipped. Only the empty singular dirs (agent/) are synced.

Impact

Users lose their subagents, commands, and plugins on sync because the tool looks in the wrong directory. This is a silent data loss scenario — there's no warning or error.

Workaround

Add the plural dirs manually via extraConfigPaths:

{
  "extraConfigPaths": [
    "~/.config/opencode/agents",
    "~/.config/opencode/commands",
    "~/.config/opencode/plugins",
    "~/.config/opencode/skills"
  ]
}

Expected fix

Either:

  1. Add plural variants to CONFIG_DIRS: ['agent', 'agents', 'command', 'commands', ...]
  2. Replace singular with plural to match what opencode actually creates
  3. Check both singular and plural and sync whichever exists

Environment

  • opencode-synced: v0.9.0 (latest release)
  • opencode: 1.18.3
  • OS: macOS

Note: The main branch already adds skills/ and ~/.agents/ sync (gated by includeOpencodeSkills/includeAgentsDir), but the singular/plural mismatch for agent/commands/plugins persists and no release includes these fixes yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions