Skip to content

fix(embedder): make edenai selectable everywhere it is documented - #1819

Closed
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/edenai-embedder-lists
Closed

sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/edenai-embedder-lists

Conversation

@sloemo01

Copy link
Copy Markdown
Contributor

What

Fixes #1815. edenai was added as an embedder (#705) and documented, but four lists still carried the older five-backend set — so the flag rejected it, the interactive prompts omitted it, and the HTTP server fell through to the keyless mock.

Fix

  • init --embedder: add edenai to the click.Choice + help text.
  • reindex --embedder: add edenai to the click.Choice.
  • advanced-mode prompt (mode_selection.py): add edenai to embedder_choices.
  • server _build_embedder (app.py): add the edenai branch → EdenAIEmbedder (default model amazon/amazon.titan-embed-text-v2:0), and update the mock-fallback warning.

Verified

  • --embedder edenai now accepted by the CLI flag.
  • REPOWISE_EMBEDDER=edenai + EDENAI_API_KEY builds EdenAIEmbedder on the server (was KeylessEmbedder).

Tests

  • New test_edenai_resolves_with_api_key in test_embedder_resolution.py — asserts edenai resolves to EdenAIEmbedder with degraded: False.
  • tests/unit/server/mcp/test_embedder_resolution.py — 17 passed, no regression.
  • Ruff clean.

edenai was added as an embedder (repowise-dev#705) but four lists still carried the
older five-backend set, so the flag rejected it, the interactive prompts
omitted it, and the HTTP server fell through to the keyless mock (issue
repowise-dev#1815).

- init --embedder: add edenai to the click.Choice + help text
- reindex --embedder: add edenai to the click.Choice
- advanced-mode prompt: add edenai to embedder_choices
- server _build_embedder: add the edenai branch (EdenAIEmbedder)

Fixes repowise-dev#1815
@repowise-bot

repowise-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

✅ Health of changed files: 2.1 (unchanged)

📋 At a glance
5 hotspots touched · 4 co-change pairs left out · 5 files with recent fix history.

Files & modules (2)
  • packages (4 files)
    • .../server/app.py
    • .../init_cmd/command.py
    • .../ui/mode_selection.py
    • .../commands/reindex_cmd.py
  • tests (1 file)
    • .../mcp/test_embedder_resolution.py

✅ Health gate: passed

📌 Before you merge

  • Run .../cli/test_editor_setup.py, .../cli/test_health_rescore_gate.py, .../cli/test_workspace_deterministic.py, .../cli/test_embedder_resolution.py (+7 more): they import the changed files
  • .../init_cmd/workspace.py changed together with .../init_cmd/command.py in 22 past commits and isn't in this PR
  • .../cli/helpers.py changed together with .../init_cmd/command.py in 14 past commits and isn't in this PR
  • .../update_cmd/command.py changed together with .../init_cmd/command.py in 11 past commits and isn't in this PR
  • ...and 1 more co-change partner not in this PR
  • Docs that usually track this code: docs/reference/CLI_REFERENCE.md
🔎 More signals (3)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (4 with dependents)"]
    f_packages_cli_src_repowise_cli_commands_init_cmd_command_py[".../init_cmd/command.py 🔥"]:::changed
    f_packages_cli_src_repowise_cli_commands_reindex_cmd_py[".../commands/reindex_cmd.py 🔥"]:::changed
    f_packages_cli_src_repowise_cli_ui_mode_selection_py[".../ui/mode_selection.py 🔥"]:::changed
    f_packages_server_src_repowise_server_app_py[".../server/app.py 🔥"]:::changed
  end
  f_packages_cli_src_repowise_cli_commands_doctor_cmd_repo_checks_py[".../doctor_cmd/repo_checks.py"]
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py --> f_packages_cli_src_repowise_cli_commands_doctor_cmd_repo_checks_py
  f_packages_cli_src_repowise_cli_commands_generate_cmd_command_py[".../generate_cmd/command.py"]
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py --> f_packages_cli_src_repowise_cli_commands_generate_cmd_command_py
  f_packages_cli_src_repowise_cli_commands_hook_cmd_py[".../commands/hook_cmd.py"]
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py --> f_packages_cli_src_repowise_cli_commands_hook_cmd_py
  f_packages_cli_src_repowise_cli_commands_init_cmd___init___py[".../init_cmd/__init__.py"]
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py --> f_packages_cli_src_repowise_cli_commands_init_cmd___init___py
  f_packages_cli_src_repowise_cli_commands_reindex_cmd_py --> f_packages_cli_src_repowise_cli_commands_doctor_cmd_repo_checks_py
  f_packages_cli_src_repowise_cli_commands_reindex_cmd_py --> f_packages_cli_src_repowise_cli_commands_generate_cmd_command_py
  f_packages_cli_src_repowise_cli_upgrade_py[".../cli/upgrade.py"]
  f_packages_cli_src_repowise_cli_commands_reindex_cmd_py --> f_packages_cli_src_repowise_cli_upgrade_py
  f_packages_cli_src_repowise_cli_commands_init_cmd_generation_py[".../init_cmd/generation.py"]
  f_packages_cli_src_repowise_cli_ui_mode_selection_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_generation_py
  f_packages_cli_src_repowise_cli_commands_init_cmd_reporting_py[".../init_cmd/reporting.py"]
  f_packages_cli_src_repowise_cli_ui_mode_selection_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_reporting_py
  f_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py[".../init_cmd/workspace.py"]
  f_packages_cli_src_repowise_cli_ui_mode_selection_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py
  f_packages_cli_src_repowise_cli_commands_update_cmd_command_py[".../update_cmd/command.py"]
  f_packages_cli_src_repowise_cli_ui_mode_selection_py --> f_packages_cli_src_repowise_cli_commands_update_cmd_command_py
  f_packages_cli_src_repowise_cli_helpers_py[".../cli/helpers.py"]
  f_packages_server_src_repowise_server_app_py --> f_packages_cli_src_repowise_cli_helpers_py
  f_packages_cli_src_repowise_cli_main_py[".../cli/main.py"]
  f_packages_server_src_repowise_server_app_py --> f_packages_cli_src_repowise_cli_main_py
  f_packages_core_src_repowise_core_pipeline_orchestrator_py[".../pipeline/orchestrator.py"]
  f_packages_server_src_repowise_server_app_py --> f_packages_core_src_repowise_core_pipeline_orchestrator_py
  more(["+4 more dependents"])
  PR --> more
  w_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py(["⚠️ .../init_cmd/workspace.py changed together 22×, not in PR"]):::warn
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py -.- w_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py
  w_packages_cli_src_repowise_cli_helpers_py(["⚠️ .../cli/helpers.py changed together 14×, not in PR"]):::warn
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py -.- w_packages_cli_src_repowise_cli_helpers_py
  t_tests_unit_cli_test_editor_setup_py(["✅ .../cli/test_editor_setup.py"]):::guard
  t_tests_unit_cli_test_editor_setup_py -.-> f_packages_cli_src_repowise_cli_commands_init_cmd_command_py
  t_tests_unit_cli_test_embedder_resolution_py(["✅ .../cli/test_embedder_resolution.py"]):::guard
  t_tests_unit_cli_test_embedder_resolution_py -.-> f_packages_cli_src_repowise_cli_commands_reindex_cmd_py
  t_tests_unit_cli_test_file_page_volume_prompt_py(["✅ .../cli/test_file_page_volume_prompt.py"]):::guard
  t_tests_unit_cli_test_file_page_volume_prompt_py -.-> f_packages_cli_src_repowise_cli_ui_mode_selection_py
  classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
  classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
  classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Solid arrows: code that imports the changed files (16 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (5)

  • .../server/app.py: 20 commits/90d, 6 dependents · primary owner: Raghav Chamadiya (81%)
  • .../init_cmd/command.py: 53 commits/90d, 7 dependents · primary owner: Raghav Chamadiya (92%)
  • .../ui/mode_selection.py: 17 commits/90d, 12 dependents · primary owner: Swati Ahuja (52%)
2 more
  • .../mcp/test_embedder_resolution.py: 4 commits/90d, 0 dependents · primary owner: Raghav Chamadiya (93%)
  • .../commands/reindex_cmd.py: 11 commits/90d, 6 dependents · primary owner: Raghav Chamadiya (57%)

🔗 Hidden coupling (1 file)

  • .../init_cmd/command.py co-changes with these files (not in this PR):
    • .../init_cmd/workspace.py (22×, 🔴 strong)
    • .../cli/helpers.py (14×, 🟡 notable)
    • .../update_cmd/command.py (11×, 🟡 notable)
    • .../init_cmd/generation.py (10×, 🟡 notable)

👀 Suggested reviewers @RaghavChamadiya


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-08-21 13:10 UTC

MVS-source added a commit to MVS-source/repowise that referenced this pull request Aug 21, 2026
The reindex flag carries its own click.Choice and was left on the same
older list, so `repowise reindex --embedder edenai` was rejected while
CLI_REFERENCE.md documents it alongside the init flag.

Spotted by @sloemo01 while working the same issue in repowise-dev#1819, which found
this one where my own sweep of the choice lists had missed it.
@MVS-source

Copy link
Copy Markdown
Contributor

Heads up that this raced with #1820, one second apart, details in #1815.

Your reindex_cmd.py line is a real catch that my own sweep missed, so I have taken it into #1820 with the credit. If the maintainers go with yours instead, three spots are still open and they are one line each:

  • mode_selection.py, the click.Choice in _prompt_index_only_search, the index-only Search prompt. Separate literal from embedder_choices, which is how the two drifted apart.
  • mode_selection.py, _resolve_embedder_from_env. It is a third copy of the detection chain and does not read EDENAI_API_KEY, so a machine whose only key is that one still defaults to mock. Worth reading it last, right before the mock, the way cli/providers/embedders.py does, so an unrelated key cannot outrank a backend the user was already resolving to.
  • the --provider help string in init_cmd/command.py, which also omits edenai. That option has no Choice, so it works, it is just missing from --help.

No strong feelings about which PR goes in.

RaghavChamadiya pushed a commit that referenced this pull request Aug 21, 2026
)

edenai was registered as an embedder and documented in CLI_REFERENCE.md and
CONFIG.md by #705, but four lists were left on the older five-backend set:

- init --embedder and reindex --embedder click.Choice rejected the value
- neither interactive prompt offered it (_prompt_generation and
  _prompt_index_only_search)
- _resolve_embedder_from_env never read EDENAI_API_KEY, so a machine whose
  only key is that one defaulted to the mock and semantic search ran on
  vectors that cannot match the index
- server _build_embedder stopped at openrouter and fell through to
  KeylessEmbedder with only a warning, reporting healthy meanwhile (#306)

EDENAI_API_KEY is read last, before the mock, mirroring the shared resolver
in cli/providers/embedders.py so an unrelated key cannot outrank a backend
the user was already resolving to.

The reindex flag was spotted by @sloemo01 in #1819.

Fixes #1815
@RaghavChamadiya

Copy link
Copy Markdown
Member

Thanks @sloemo01. This one lost to a coin toss rather than to anything about the work: you opened at 13:09:48 and @MVS-source opened #1820 at 13:09:49, one second apart, both against an issue filed 43 minutes earlier. Neither of you could have seen the other.

I merged #1820, and I want to be specific about why rather than leave it looking arbitrary.

The four source files are the same in both. Where they differ is that #1815 lists four symptoms and this fixes two and a half of them. The two it does not reach are _prompt_index_only_search, the second embedder prompt further down mode_selection.py, and _resolve_embedder_from_env, which never read EDENAI_API_KEY. That second one is the reason this could not wait for the release: nothing errors. A machine whose only key is EDENAI_API_KEY silently gets the mock embedder, the server logs healthy, and semantic search runs on vectors that cannot match the index. Merging this would have closed #1815 with the quiet half still broken, which is a worse outcome than leaving it open.

Your PR was not wasted, and this is the part worth saying. reindex --embedder carries its own click.Choice and MVS-source's sweep of the choice lists had missed it. They picked it up from your diff and credited you in the commit, so that fix is on main because you found it.

Closing this as superseded, not as wrong.

Separately, three of yours went in today: #1806, #1808 and #1810, all four coverage and worktree and embedder-key bugs. #1789 is the one I would pick up next. I left a comment on it with a measurement: the call-edge half is right and I want it, the import branch needs its file anchor back, and it is one and_ from mergeable.

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.

[Bug] The edenai embedder is documented but cannot be selected

3 participants