Repository navigation
An empty first run no longer strands an indicator off its prepared pane - #105
Merged
Merged
Conversation
While a chart still has no bars, an engine run cannot have executed the script, so a model carrying no output is deferred instead of applied: the prepared placeholder keeps its pane, title, and loading spinner, and the one-shot pane re-route stays available for the first real model. Loading still ends with the run, not with output - a script that runs over real bars and plots nothing clears its spinner and announces as before. Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d7d82dbd-08fe-4862-8515-a04cee61a553) |
|
All contributors have signed the CLA ✍️ ✅ |
Member
Author
|
I have read the CLA Document and I hereby sign the CLA |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
applyModelconsumed the one-shot pane re-route off fabricated metadata (overlay: false, generic Indicator title), clearedloading, and the indicator stayed stranded in an empty sub pane even after bars arrived (the later real model only value-patched — no title, no pane, unmounted series ids).record.loadingand the chart itself has zero bars, a model carrying no output of any kind (series, drawings, bar colors, trades) is deferred — placeholder, pane, spinner, and the pending run-cause all stay untouched; the first real model still routes through the existing self-heal. The bars condition keeps the guard narrow: loading ends when a run completes, not when it produces output — a script that runs over real bars and plots nothing (alerts only) clears its spinner and announces exactly as before.Companion PR
Root cause lives in the engine: LuxAlgo/Vela-pinets#30 stops the PineTS engines from fabricating a model for a run that never executed the script body. This orchestrator guard is the second, engine-agnostic layer — any
ScriptingEngineemitting an empty model over a bar-less chart is handled, and either PR alone fixes the user-visible symptom for Pine.Tests
Four new orchestrator tests (stub engines, no PineTS dependency): the stranding scenario (placeholder kept, nothing announced, real model lands normally), the self-heal regression (a real first model that disagrees with the prepare-time guess still re-routes), spinner semantics (an output-free run over real bars completes the load), and the late-bars end-to-end (feed loads 0 bars, live push re-runs the session, final state is price pane / declared title / plots). The stranding, spinner, and end-to-end tests fail without the fix. Full gate green: typecheck / lint / 1442 tests / build; workspace oracle suites re-run green (vela 23/23, vela-pro 11/11).
Note
Medium Risk
Changes indicator mount and event timing on a core orchestrator path, but the guard is narrowly scoped (loading + zero bars + no output) and covered by new regression tests.
Overview
Fixes indicators that were added while the chart’s initial bar load was still empty (saved layout restore, auth race, slow feed). An output-free first model used to be treated as real script output, which re-routed the pane off prepare-time metadata, cleared loading, and left a generic empty sub pane even after data arrived.
EngineOrchestrator.applyModelnow returns a boolean and defers models that have no series, drawings, bar colors, trades, etc. when the indicator is still loading andthis.bars.length === 0. The placeholder pane, spinner, andpendingCausestay put;onModelskipsindicator:added/ script-run events until a real apply. The first model with real output still uses the existing one-shot pane self-heal. Loading still ends when a run completes over real bars, not when output exists (alerts-only scripts unchanged).Changelog updated; four orchestrator tests cover stranding, self-heal regression, alerts-only completion, and empty-then-live feed end-to-end.
Reviewed by Cursor Bugbot for commit d6d2a8a. Bugbot is set up for automated code reviews on this repo. Configure here.