Skip to content

Separate Reflexio setup env from claude-smart runtime env #105

Description

@wenchanghan

Problem

claude-smart currently has a partial boundary between Reflexio setup state and claude-smart runtime state:

  • Runtime services already load ~/.claude-smart/.env through REFLEXIO_ENV_FILE so a shared OSS Reflexio ~/.reflexio/.env cannot leak into claude-smart backend startup.
  • The Python/Bash runtime path treats ~/.claude-smart/.env as the claude-smart runtime config file.
  • Some setup surfaces still write claude-smart-specific keys into ~/.reflexio/.env, which makes the conceptual ownership boundary muddy and creates room for future host/config drift.

This is related to, but broader than, PR #99. PR #99 should stay focused on Windows/OpenCode first-try install behavior.

Current leaks to clean up

  • bin/claude-smart.js: npm installer mirrors local defaults into both ~/.reflexio/.env and ~/.claude-smart/.env, including CLAUDE_SMART_HOST, CLAUDE_SMART_USE_LOCAL_CLI, CLAUDE_SMART_USE_LOCAL_EMBEDDING, and CLAUDE_SMART_READ_ONLY.
  • scripts/setup-claude-smart.sh: interactive setup writes CLAUDE_SMART_READ_ONLY and local CLAUDE_SMART_* defaults into ~/.reflexio/.env.
  • plugin/dashboard/lib/config-file.ts and the dashboard configure page read/write ~/.reflexio/.env for claude-smart runtime flags.
  • README/Troubleshooting still describe claude-smart runtime flags under ~/.reflexio/.env in places.

Desired boundary

  • ~/.reflexio/.env: Reflexio setup/connection state only, for example REFLEXIO_URL, REFLEXIO_API_KEY, and REFLEXIO_USER_ID.
  • ~/.claude-smart/.env: claude-smart runtime/host/provider state, for example CLAUDE_SMART_HOST, CLAUDE_SMART_USE_LOCAL_CLI, CLAUDE_SMART_USE_LOCAL_EMBEDDING, CLAUDE_SMART_READ_ONLY, CLAUDE_SMART_OPENCODE_PATH, CLAUDE_SMART_CLI_PATH, and related runtime knobs.

Acceptance criteria

  • Installers no longer generate host-specific CLAUDE_SMART_* runtime keys in ~/.reflexio/.env.
  • Setup/dashboard/docs all agree on which file owns each key.
  • Legacy installs with CLAUDE_SMART_READ_ONLY=1 or other claude-smart keys in ~/.reflexio/.env are migrated or respected without silently changing behavior.
  • Backend/dashboard startup continues to read the intended runtime config from ~/.claude-smart/.env.
  • Tests cover local mode, managed mode, read-only mode, dashboard config writes, and at least one legacy migration case.

Notes

Do this separately from PR #99 to avoid expanding a Windows/OpenCode compatibility PR into cross-host setup/dashboard semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions