Skip to content

feat(config): add separate base URLs for summary and embedding models#99

Open
larroy wants to merge 1 commit into
openclaw:mainfrom
larroy:improv_base_urls
Open

feat(config): add separate base URLs for summary and embedding models#99
larroy wants to merge 1 commit into
openclaw:mainfrom
larroy:improv_base_urls

Conversation

@larroy

@larroy larroy commented Jul 9, 2026

Copy link
Copy Markdown

Introduce per-purpose OpenAI endpoint overrides so summaries and embeddings can target different endpoints instead of sharing one:

  • summary_base_url (--summary-base-url, GITCRAWL_SUMMARY_BASE_URL)
  • embed_base_url (--embed-base-url, GITCRAWL_EMBED_BASE_URL)

Each resolves to its per-purpose value first, then falls back to the shared GITCRAWL_OPENAI_BASE_URL / OPENAI_BASE_URL, so existing single-endpoint setups are unaffected. The embedding client now uses the resolved embed endpoint at both call sites, and configure/doctor output surfaces both fields.

Document the fallback chain and resolution order in docs/configuration.md and docs/reference.md, and add config/CLI tests covering the config value, env override, and shared fallback.

@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 3:09 AM ET / 07:09 UTC.

Summary
Adds separate summary and embedding OpenAI base URL fields, environment overrides, configure flags, resolved diagnostic output, embedding client routing, documentation, and tests.

Reproducibility: not applicable. This PR adds a new configuration mode rather than fixing an established current-main failure.

Review metrics: 3 noteworthy metrics.

  • Configuration surface: 2 fields, 2 env vars, 2 CLI flags. Maintainers would accept six new permanent user-facing inputs.
  • Active endpoint consumers: 2 embedding, 0 summary. Only embed_base_url changes executable request routing today.
  • Patch scope: 6 files, +228/-9. The current head is focused and the earlier changelog concern has been removed.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Post redacted terminal output or endpoint-server logs showing a nonzero embedding request reaches embed_base_url.
  • Obtain feature-owner confirmation on adding summary_base_url before summary commands exist.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Configure and doctor output proves value persistence and resolution, but the zero-selection embed run does not prove an API request used embed_base_url; add redacted nonzero request output or endpoint logs, update the PR body, and ask a maintainer for @clawsweeper re-review if review does not rerun.

Risk before merge

  • [P1] Merging establishes two fields, two environment variables, and two CLI flags as a permanent user-facing contract; summary_base_url has no current request consumer.
  • [P1] The submitted runtime evidence does not verify endpoint routing because the embedding command selected zero records and sent no observable request.
  • [P1] Only security scans are reported on the current head; no maintainer review confirms the product direction.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared endpoint as the compatibility fallback, accept the split endpoint contract only with owner approval, and require a redacted nonzero embedding request trace that visibly reaches embed_base_url before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The remaining blockers are maintainer product direction and contributor-owned live routing proof, not a narrow automatable code repair.

Maintainer decision needed

  • Question: Should gitcrawl expose summary_base_url now, before a summary request path exists, or limit this change to the currently usable embedding override?
  • Rationale: The patch creates durable config, environment, and CLI contracts, and implementation correctness cannot decide when unused future-facing surface should become public.
  • Likely owner: Peter Steinberger — He introduced the OpenAI configuration and client behavior this PR extends.
  • Options:
    • Accept both after proof (recommended): Keep symmetrical per-purpose settings and merge after a real embedding request demonstrates endpoint routing.
    • Narrow to embedding: Ship embed_base_url now and introduce summary_base_url with the future summary implementation.
    • Keep one shared endpoint: Decline the additional configuration surface and retain the existing endpoint contract.

Security
Cleared: The focused patch adds no dependency, workflow, permission, credential-resolution, executable-download, or supply-chain changes.

Review details

Best possible solution:

Keep the shared endpoint as the compatibility fallback, accept the split endpoint contract only with owner approval, and require a redacted nonzero embedding request trace that visibly reaches embed_base_url before merge.

Do we have a high-confidence way to reproduce the issue?

Not applicable; this PR adds a new configuration mode rather than fixing an established current-main failure.

Is this the best way to solve the issue?

Unclear overall: the additive shared-endpoint fallback is the safest implementation for embeddings, but exposing summary_base_url before a summary client exists requires maintainer intent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 808b4dabeaa4.

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is a low-urgency additive configuration feature rather than a regression or broken user workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Configure and doctor output proves value persistence and resolution, but the zero-selection embed run does not prove an API request used embed_base_url; add redacted nonzero request output or endpoint logs, update the PR body, and ask a maintainer for @clawsweeper re-review if review does not rerun.
Evidence reviewed

What I checked:

  • Merged-tree scope: GitHub's synthetic merge commit applies only the six intended config, CLI, test, and documentation files to current main, with no unrelated release or workflow changes. (internal/cli/app.go:277, a5ae695db4e7)
  • Current embedding routing: Both OpenAI client construction sites in the merged tree use embedBaseURL, covering semantic-search query embedding and repository embedding while retaining the shared endpoint fallback. (internal/cli/app.go:664, a5ae695db4e7)
  • Future-facing summary surface: The patch exposes and resolves summary_base_url, but current code has no summary OpenAI client; existing documentation describes summary_model as reserved for future summary commands. (docs/configuration.md:109, a5ae695db4e7)
  • Previous finding resolved: The current head differs from the previously reviewed head only by removing three CHANGELOG.md lines, so the release-owned changelog finding is fixed. (CHANGELOG.md:1, 6df7bec0660b)
  • Feature provenance: Current-main blame attributes the OpenAI config struct and both shared-base-URL embedding call sites to release commit 10725cf by Peter Steinberger. (internal/config/config.go:38, 10725cf8aa5d)
  • Live proof limitation: The contributor's configure and doctor output shows the resolved settings, but the embed result selected and embedded zero items, so no embedding API request was observed. (6df7bec0660b)

Likely related people:

  • Peter Steinberger: Authored the commit containing the current OpenAI config contract and both shared-base-URL embedding client call sites, making him the strongest product-direction owner. (role: introduced current behavior; confidence: high; commits: 10725cf8aa5d; files: internal/config/config.go, internal/cli/app.go)
  • vincentkoc: Has the largest commit count across the central CLI and config files and is a useful secondary reviewer for implementation fit. (role: recent area contributor; confidence: medium; files: internal/cli/app.go, internal/config/config.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-09T19:26:32.522Z sha 89f5189 :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entries

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 9, 2026
@plarroy-nv

Copy link
Copy Markdown

Real behavior proof:

plarroy@ip-172-31-63-139 ~/gitcrawl (improv_colors)> gitcrawl configure \
                                                             --summary-base-url https://summary.example.test/v1 \
                                                             --embed-base-url https://embed.example.test/v1
configure
{
  "config_path": "/home/plarroy/.config/gitcrawl/config.toml",
  "embed_base_url": "https://embed.example.test/v1",
  "embed_model": "text-embedding-3-small",
  "embedding_basis": "title_original",
  "summary_base_url": "https://summary.example.test/v1",
  "summary_model": "gpt-5.4",
  "updated": true
}
plarroy@ip-172-31-63-139 ~/gitcrawl (improv_colors)> gitcrawl doctor
doctor
{
  "api_supported": false,
  "cluster_count": 4040,
  "config_exists": true,
  "config_path": "/home/plarroy/.config/gitcrawl/config.toml",
  "db_path": "/home/plarroy/.local/share/gitcrawl/gitcrawl.db",
  "db_schema": {
    "path": "/home/plarroy/.local/share/gitcrawl/gitcrawl.db",
    "exists": true,
    "current_version": 4,
    "supported_version": 4,
    "state": "current",
    "current": true,
    "pending_migration": false,
    "legacy": false,
    "newer": false,
    "pending_migrations": [],
    "pr_details": {
      "details_table": true,
      "files_table": true,
      "files_position_key": true,
      "duplicate_path_files_supported": true,
      "state": "supported"
    }
  },
  "embed_base_url": "https://embed.example.test/v1",
  "embed_model": "text-embedding-3-small",
  "embedding_basis": "title_original",
  "executable_path": "/home/plarroy/.local/bin/gitcrawl",
  "github_token_present": false,
  "github_token_source": "",
  "last_sync_at": "2026-07-09T16:19:26.2657342Z",
  "open_thread_count": 6252,
  "openai_key_present": false,
  "openai_key_source": "",
  "portable_refresh": {},
  "portable_store_status": {},
  "repair_action": "",
  "repository_count": 1,
  "runtime": {
    "build_modified": true,
    "build_revision": "89f518984ae53c5bb11bb4f41f1cc1a0ba8b66e9",
    "build_time": "2026-07-09T19:18:18Z",
    "executable_path": "/home/plarroy/.local/bin/gitcrawl",
    "go_version": "go1.26.4",
    "module_path": "github.com/openclaw/gitcrawl",
    "module_version": "v0.7.1-0.20260709191818-89f518984ae5+dirty",
    "version": "dev"
  },
  "runtime_db_health": {},
  "source_db_health": {
    "exists": true,
    "health": "ok",
    "manifest": "missing",
    "manifest_path": "/home/plarroy/.local/share/gitcrawl/gitcrawl.db.manifest.json",
    "path": "/home/plarroy/.local/share/gitcrawl/gitcrawl.db",
    "sha256": "b7257a1db4eca1a31e757ba672cf6f5d6e971b977c72e50c8bfdef4ce4452129",
    "size": 352727040
  },
  "source_db_schema": {
    "path": "/home/plarroy/.local/share/gitcrawl/gitcrawl.db",
    "exists": true,
    "current_version": 4,
    "supported_version": 4,
    "state": "current",
    "current": true,
    "pending_migration": false,
    "legacy": false,
    "newer": false,
    "pending_migrations": [],
    "pr_details": {
      "details_table": true,
      "files_table": true,
      "files_position_key": true,
      "duplicate_path_files_supported": true,
      "state": "supported"
    }
  },
  "summary_base_url": "https://summary.example.test/v1",
  "summary_model": "gpt-5.4",
  "thread_count": 6252,
  "version": "dev"
}
plarroy@ip-172-31-63-139 ~/gitcrawl (improv_colors)>
plarroy@ip-172-31-63-139 ~/gitcrawl (improv_colors)> gitcrawl embed openclaw/openclaw
embed
{
  "repository": "openclaw/openclaw",
  "model": "azure/openai/text-embedding-3-small",
  "basis": "title_original",
  "selected": 0,
  "embedded": 0,
  "skipped": 0,
  "status": "success",
  "run_id": 6
}

Introduce per-purpose OpenAI endpoint overrides so summaries and
embeddings can target different endpoints instead of sharing one:

- summary_base_url  (--summary-base-url, GITCRAWL_SUMMARY_BASE_URL)
- embed_base_url    (--embed-base-url,   GITCRAWL_EMBED_BASE_URL)

Each resolves to its per-purpose value first, then falls back to the
shared GITCRAWL_OPENAI_BASE_URL / OPENAI_BASE_URL, so existing
single-endpoint setups are unaffected. The embedding client now uses
the resolved embed endpoint at both call sites, and configure/doctor
output surfaces both fields.

Document the fallback chain and resolution order in
docs/configuration.md and docs/reference.md, and add config/CLI tests
covering the config value, env override, and shared fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@larroy larroy force-pushed the improv_base_urls branch from 89f5189 to 6df7bec Compare July 9, 2026 22:43
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants