Troubleshoot AI Pine Editing
Use this page when AI Pine editing in Algo Lab does not behave as expected. Preserve unsaved source before refreshing and copy any exact error message into a temporary note.
A message cannot be sent
Section titled “A message cannot be sent”Check the composer and the current chat:
- wait for chat history to finish loading;
- stop or finish the request already running;
- approve or reject a pending Agent decision when prompted;
- accept or reject a staged editor change;
- confirm a strategy tab and chat tab are active; and
- check that AI credits are available.
The message must contain text. Enter sends; Shift+Enter adds a new line.
The response explains but does not edit code
Section titled “The response explains but does not edit code”Mode controls what may change:
- Ask is conversational and read-only.
- Research can inspect evidence and run a bounded research step, but it does not apply editor edits.
- Agent can propose or stage Pine changes and use the evidence-gated research workflow when the account supports it.
Switch to Agent for an edit request. Name the intended behavior, scope, and smallest acceptable change; an ambiguous request may still receive an explanation instead of a patch.
The answer discusses the wrong strategy or evidence
Section titled “The answer discusses the wrong strategy or evidence”-
Make the intended strategy the active editor tab.
-
Name the function or line range in the prompt. A text selection is not sent as a separate focused attachment in Algo Lab.
-
Remove unrelated report, image, and shared-tab chips.
-
Confirm the Case Study chip points to the intended investigation, or choose No Case Study.
-
Start a new chat if earlier messages depend on assumptions that no longer apply.
See Control AI context and attachments.
An attachment is missing
Section titled “An attachment is missing”Use + → Add Report, Share Active Tab, or a named open tab. Algo Lab keeps one selected report in the chat at a time. Images are staged only for the next message and disappear after that message is captured.
If an image fails, export it as a standard PNG or JPEG, crop it, and retry. If a changed secondary tab matters, share it again and remove unrelated code attachments so the relevant material fits the model context budget.
A staged diff is not acceptable
Section titled “A staged diff is not acceptable”Do not accept it merely to resume the chat. The current review is all-or-nothing:
- Reject All leaves the active script unchanged.
- Accept All replaces the editor content with the proposal.
There is no per-hunk accept control. Reject an oversized proposal and request a smaller edit, or make the intended lines manually. After accepting, validate, save, and rerun the same research scope.
Validation does not run
Section titled “Validation does not run”Open Editor options and confirm Validation is enabled.
- Internal engine is the default and does not require a TradingView username.
- TradingView API requires a saved username under Account Integrations.
- Validation runs automatically after editing settles; there is no separate manual Validate button in the Algo Lab toolbar.
Switch providers to distinguish an internal-runtime diagnostic from an external TradingView request problem. A clean result from either provider does not verify runtime behavior. See Validate Pine Script in Algo Lab.
Accepted code fails validation
Section titled “Accepted code fails validation”- Leave it unsaved if you want the last server version preserved.
- Read the first relevant diagnostic.
- Use Fix with AI for a bounded staged repair, or edit manually.
- Revalidate after the change.
- Test the final source in TradingView with the intended chart and inputs.
If the direction is wrong, use undo while its history is available or restore the saved source instead of stacking speculative fixes.
Code remains unsaved
Section titled “Code remains unsaved”An unsaved tab shows a change indicator, and the Save action remains available. With Auto Save enabled, Algo Lab saves after edits settle; otherwise use Save explicitly.
If saving fails:
- keep the page open;
- copy the current source outside the browser;
- check connectivity and retry Save; and
- refresh only after preserving the source.
A strategy tab disappeared
Section titled “A strategy tab disappeared”Closing a normal strategy tab archives it after confirmation. Open Editor options → Manage archive, then search for and restore the strategy. Permanent deletion from the archive cannot be undone through the editor.
A report does not appear in context
Section titled “A report does not appear in context”For a saved report, choose + → Add Report and search for it. Selecting a different report replaces the current report attachment. For a handoff from an analysis page, let Algo Lab finish loading before changing chats; temporary handoff data may not persist if the report was not saved.
Confirm that the report’s symbol, timeframe, strategy, and date window match the current investigation before using it as evidence.
Credits block AI use
Section titled “Credits block AI use”Ask, Research, Agent, and Fix with AI require the account’s current AI entitlement and available credits. Check the live Billing UI rather than relying on a fixed cost in documentation. Reducing irrelevant context improves clarity but does not imply a fixed credit price.
The editor is slow
Section titled “The editor is slow”- Pause Validation and AI Autocomplete separately to isolate background work.
- Resolve a large staged diff.
- Close unneeded chat tabs and remove unrelated attachments.
- Reproduce with one strategy tab and a short chat.
Record whether the slowdown follows one large script or affects every tab. When asking support, include the route, mode, enabled editor options, exact steps, browser and operating-system versions, and a redacted screenshot or short recording. Never include provider keys, webhook secrets, authorization headers, or unredacted account data.