fix(intent-editor): keep Generate clickable after a cross-model failure#6298
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the Intent Editor, generating a model that references another model cross-model (e.g.
products.intent→uoms) before the dependency exists fails — correctly — with:The error is expected. The bug is that the Generate button then becomes permanently disabled: after the user generates the
uomsmodel, they can't retryproductswithout 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 byCrossModelSupportin the/generatepath); the/parseendpoint never does cross-model resolution, so the live/debounced parse never re-produces the issue. It stayed pinned in$scope.issuesand kept the button dead until something cleared it.Fix
ng-disabled="state.isBusy". The backend re-parses and re-validates on every/generatecall and returns422+ 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).$scope.issueson 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.IntentEditorLoadsITstill exercises the Generate flow.Verification
Verified locally against
dirigiblelabs/sample-intent-multi-model: openproducts.intent→ Generate shows the cross-model error but the button stays enabled → openuoms.intent→ Generate succeeds → back onproducts.intent, Generate succeeds and the error clears from the strip. No close/reopen needed.🤖 Generated with Claude Code