Skip to content

fix: run the backend under its own "claude-smart" org id#85

Open
yyiilluu wants to merge 1 commit into
mainfrom
feat/scope-to-own-org
Open

fix: run the backend under its own "claude-smart" org id#85
yyiilluu wants to merge 1 commit into
mainfrom
feat/scope-to-own-org

Conversation

@yyiilluu

@yyiilluu yyiilluu commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

claude-smart's vendored backend and the enterprise self-host backend both defaulted to the self-host-org org, so they shared and clobbered ~/.reflexio/configs/config_self-host-org.json — corrupting each other's storage_config.

This runs claude-smart's backend under its own claude-smart org id, giving it a dedicated config_claude-smart.json and ending the collision.

Changes

  • plugin/scripts/backend-service.shexport REFLEXIO_DEFAULT_ORG_ID="claude-smart" (hard-set, not :--defaulted, so a value in the shared ~/.reflexio/.env can't drag us back onto self-host-org).
  • plugin/src/claude_smart/cli.py — config-path constant now derives from _REFLEXIO_ORG_ID = "claude-smart"config_claude-smart.json, kept in sync with the export.
  • tests/test_cli_clear_all.py — fixture updated to the new config path.

Relies on the reflexio backend reading REFLEXIO_DEFAULT_ORG_ID for the no-auth org resolver (companion change in the reflexio package).

Test Plan

  • pytest tests/test_cli_clear_all.py — 16 passed.

Summary by CodeRabbit

  • Bug Fixes
    • The app now consistently uses the intended organization configuration on startup and in the CLI.
    • Prevents settings and local data from being picked up from a shared or incorrect configuration.
    • Clear-all behavior now targets the same organization-specific configuration as the rest of the app.

claude-smart and the enterprise self-host backend both defaulted to the
"self-host-org" org and fought over ~/.reflexio/configs/config_self-host-org.json,
corrupting each other's storage_config.

Set REFLEXIO_DEFAULT_ORG_ID=claude-smart in backend-service.sh (hard-set,
not :-defaulted, so a value in the shared ~/.reflexio/.env can't drag us
back onto self-host-org), and point the CLI's config-path constant at
config_claude-smart.json to match. Relies on the reflexio backend reading
REFLEXIO_DEFAULT_ORG_ID for the no-auth org resolver.

Update the clear-all test fixture to the new config path.
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1797fcb1-f328-4152-a252-803529c5ab75

📥 Commits

Reviewing files that changed from the base of the PR and between 14d2ac0 and 55c2ebd.

📒 Files selected for processing (3)
  • plugin/scripts/backend-service.sh
  • plugin/src/claude_smart/cli.py
  • tests/test_cli_clear_all.py

📝 Walkthrough

Walkthrough

The backend service now exports REFLEXIO_DEFAULT_ORG_ID=claude-smart. The CLI now derives its Reflexio config path from claude-smart, and the clear-all test fixture uses config_claude-smart.json.

Changes

Org config alignment

Layer / File(s) Summary
Backend org id export
plugin/scripts/backend-service.sh
REFLEXIO_DEFAULT_ORG_ID is exported as claude-smart before backend startup.
CLI config path and fixture
plugin/src/claude_smart/cli.py, tests/test_cli_clear_all.py
_REFLEXIO_ORG_ID is set to claude-smart, _REFLEXIO_CONFIG_PATH points to config_claude-smart.json, and the clear-all harness uses the matching config file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny hopped through config land,
With claude-smart stamped by paw and hand.
The shell and CLI now agree,
On one snug burrow, neat and free.
🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: moving the backend to its own claude-smart org ID.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/scope-to-own-org

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant