Repository navigation
[ENG-1706] Show an unnamed connection's engine as its label in the datasource context - #563
Conversation
…ntext, not "(none)". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…p the engine fallback out of the catalog label. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
StpMax
left a comment
There was a problem hiding this comment.
I'm concerned that if two connections have the same label, it could cause problems. Below is the agent's comment on this:
**1. It breaks the uniqueness rule the rest of the code keeps.** Both anton and cowork-server pass every stored label through `ensure_unique_user_label`, which is unique across the whole vault, not per engine. That is why the old default was `postgres 2`. The fallback here bypasses the rule.
**2. Duplicates are not limited to two unnamed connections.** `ensure_unique_user_label` only sees stored labels, not the fallback. Example:
- connection A is created from a cowork form with no name → the prompt shows `Label: postgres` (fallback);
- connection B is created by the agent through anton's `connect_datasource`, which still stores the engine id as `_user_label` (`anton/tools.py:221`). A has no stored label, so B is saved as `postgres`, not `postgres 2`.
Both connections now read `Label: postgres`, but only B's value is stored. The `connection_display_name` docstring in cowork-server#646 notes that `connect_datasource` still does this.
**3. The eval doesn't cover it.** `scm-trap-out-of-horizon` ran with a single unlabelled connection, so we don't know how the model behaves when two connections share a label.
**Suggestion:** make the fallback unique at render time with the same rule, so the model again sees `postgres` / `postgres 2`, as in the 8/8 baseline. A rough sketch:
taken = set(_labels_by_connection(vault).values()) # or collect in a first pass
...
label = user_label
if not label:
base = engine or slug
label, n = base, 2
while label in taken:
label, n = f"{base} {n}", n + 1
taken.add(label)Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Fixed in fd33d3f and 737b441. The fallback now goes through the same suffix rule as |
|
Eval rerun on 737b441 with two unnamed connections ( |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
https://linear.app/mindsdb/issue/ENG-1706/a-handcrafted-connector-form-discards-the-engine-it-declared
What changed
build_datasource_contextrendersLabel: {user_label or engine}; the stored_user_labeland the catalog'slabelfield are unchanged.Label:, and a test pinsCatalogConnection.labelstaying""for an unnamed connection.Why this matters
mindsdb/cowork-server#646 stops writing the engine id as a default
_user_label, so a connection nobody named reached the prompt asLabel: (none)instead ofLabel: postgres. On thescm-trap-out-of-horizoneval that dropped declining-without-a-figure from 8/8 to 1/8 (judge 0.86 → 0.54). With this change and no stored label, it is 5/5 (judge 0.88).Notes for the reviewer
_user_labelkeeps meaning "someone named this". One difference from the old stored default: two unnamed connections of one engine both readLabel: postgres(the old default numbered the secondpostgres 2); their slugs still tell them apart.Ships with
Checks
uv run pytesttest_no_label_falls_back_to_the_enginefails on the old line and passes with the fix; the no-engine test fails without the slug fallbackscm-trap-out-of-horizon, T4, 5 repeats, unlabelled connection)🤖 Generated with Claude Code