Skip to content

fix(intent-editor): keep Generate clickable after a cross-model failure#6298

Merged
iliyan-velichkov merged 1 commit into
masterfrom
fix/intent-editor-generate-enabled
Jul 15, 2026
Merged

fix(intent-editor): keep Generate clickable after a cross-model failure#6298
iliyan-velichkov merged 1 commit into
masterfrom
fix/intent-editor-generate-enabled

Conversation

@iliyan-velichkov

Copy link
Copy Markdown
Contributor

Problem

In the Intent Editor, generating a model that references another model cross-model (e.g. products.intentuoms) before the dependency exists fails — correctly — with:

Cross-model relation target [UoM] (model alias [uoms], project [uoms]) cannot be resolved: no model found ... Generate the [uoms] model first ...

The error is expected. The bug is that the Generate button then becomes permanently disabled: after the user generates the uoms model, they can't retry products without closing and reopening the file (or discovering the non-obvious Refresh button).

Root cause

The button was gated on ng-disabled="state.isBusy || issues.length". The cross-model "cannot be resolved" message is a generate-time error (thrown by CrossModelSupport in the /generate path); the /parse endpoint never does cross-model resolution, so the live/debounced parse never re-produces the issue. It stayed pinned in $scope.issues and kept the button dead until something cleared it.

Fix

  • Drop the issues gate — the button is now ng-disabled="state.isBusy". The backend re-parses and re-validates on every /generate call and returns 422 + the issues on failure, so the frontend gate was UX polish, not a safety guard: clicking Generate on a bad buffer just fails gracefully and re-shows the issues (still displayed in the strip).
  • Clear $scope.issues on a successful generate, so a stale cross-model message disappears once the retry succeeds.

Frontend-only (editor.html + editor.js); no backend or test changes. IntentEditorLoadsIT still exercises the Generate flow.

Verification

Verified locally against dirigiblelabs/sample-intent-multi-model: open products.intent → Generate shows the cross-model error but the button stays enabled → open uoms.intent → Generate succeeds → back on products.intent, Generate succeeds and the error clears from the strip. No close/reopen needed.

🤖 Generated with Claude Code

Generate was gated on `issues.length`, but a cross-model "target cannot be
resolved" error is a generate-time issue thrown by CrossModelSupport, not a
parse-time one — the live/debounced parse never re-produces it, so it stayed
pinned and the button was permanently disabled. This forced users to close and
reopen the intent file (or find the non-obvious Refresh button) to retry after
generating the dependency project.

Drop the issues gate (`ng-disabled="state.isBusy"` only): the backend re-parses
and re-validates on every /generate call, so the gate was UX polish, not a
safety guard — a bad buffer just fails gracefully and re-shows its issues. Clear
the pinned issues on a successful generate so a stale cross-model message
disappears once the retry succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@iliyan-velichkov iliyan-velichkov self-assigned this Jul 15, 2026
@iliyan-velichkov
iliyan-velichkov merged commit d6566e1 into master Jul 15, 2026
10 checks passed
@iliyan-velichkov
iliyan-velichkov deleted the fix/intent-editor-generate-enabled branch July 15, 2026 13:30
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