Skip to content

refactor(llm,config): extract HTTP error mapper and move embedding helpers#4858

Merged
bug-ops merged 2 commits into
mainfrom
llm-config-dry-refactor
Jun 5, 2026
Merged

refactor(llm,config): extract HTTP error mapper and move embedding helpers#4858
bug-ops merged 2 commits into
mainfrom
llm-config-dry-refactor

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — 0 warnings
  • cargo nextest run --workspace --lib --bins — 10504 passed, 0 failed
  • cargo test --doc -p zeph-llm -p zeph-config -p zeph-core — all passed
  • Rebase on main, conflict in CHANGELOG.md resolved (kept both new entries)

Closes #4850
Closes #4840

@github-actions github-actions Bot added refactor Code refactoring without functional changes documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes core zeph-core crate size/L Large PR (201-500 lines) and removed refactor Code refactoring without functional changes labels Jun 5, 2026
…lpers

Extract `map_error_response` to `zeph_llm::http`, replacing 12 duplicate
inline error-mapping blocks across claude, openai, gonka, and cocoon
backends. Return type is `LlmError` directly, eliminating the prior
`Result`-wrapping and `unwrap_err()` call pattern at every call site.

Move `effective_embedding_model` and `stable_skill_embedding_model` from
`zeph_core::provider_factory` to `LlmConfig` in `zeph_config`, consistent
with `stt_provider_entry`. Add `impl Default for LlmConfig` using serde
deserialization of an empty TOML string so all existing `#[serde(default)]`
fields produce a well-typed default. Update all call sites in src/bootstrap/
and src/runner.rs.

Closes #4850
Closes #4840
@bug-ops bug-ops force-pushed the llm-config-dry-refactor branch from f40473d to 271405b Compare June 5, 2026 19:41
@github-actions github-actions Bot added the refactor Code refactoring without functional changes label Jun 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) June 5, 2026 19:45
@bug-ops bug-ops merged commit 94afe17 into main Jun 5, 2026
32 checks passed
@bug-ops bug-ops deleted the llm-config-dry-refactor branch June 5, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) refactor Code refactoring without functional changes rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant