Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #619 +/- ##
======================================
Coverage 39% 39%
======================================
Files 832 834 +2
Lines 41939 42110 +171
Branches 9205 9246 +41
======================================
+ Hits 16414 16581 +167
+ Misses 23432 23431 -1
- Partials 2093 2098 +5
🚀 New features to boost your workflow:
|
tkislan
force-pushed
the
tomaskislan/app-preview-inputs
branch
from
November 16, 2026 07:21
171bba4 to
3617fe3
Compare
tkislan
force-pushed
the
tomaskislan/app-preview-runs
branch
from
November 16, 2026 07:21
1e619c2 to
b8f166d
Compare
tkislan
force-pushed
the
tomaskislan/app-preview-inputs
branch
from
November 17, 2026 13:02
3617fe3 to
2bb1879
Compare
…the Windows init-block swap The app preview's run() executes the init notebook outside an editor kernel, so it needs the same lookup and the same Windows replacement for Deepnote Cloud's %%bash init block. Both move out of DeepnoteInitNotebookRunner unchanged; the lookup takes the .deepnote file's URI instead of the notebook document.
POST /__deepnote/v2/runs and GET /__deepnote/v2/runs/:runId now answer as Deepnote does instead of 501. A run executes the workspace notebook with that ID headlessly, through @deepnote/runtime-core, in a new kernel on the toolkit server the extension runs for its .deepnote file: the project's init notebook first with its saved inputs, then the notebook with the page's inputs. The poll returns Deepnote's run shape, so run() resolves and result() returns the notebook's JSON output. - The body, the notebook and the inputs are validated with Deepnote's 400 messages. - Blocks run in Deepnote's sorting-key order: the run's copy is re-keyed, because runtime-core sorts keys with localeCompare. - A failing block's error is its message, or its Python exception's name and value; a failing init block's error starts with "Init notebook failed: ". - A missing interpreter, a declined toolkit install, or a server or kernel that fails to start ends the run as internal_error. - Closing the preview cancels its runs that have not reached their first block.
The page runs a notebook whose init notebook, in a sibling file, has an input of the same name and another type, and shows each run's status and result(): an unknown input rejects, a run succeeds with the notebook's JSON and the init notebook's saved value, and a run whose last block raises ends as error with the exception and the JSON displayed before it. The notebook's sorting keys are Deepnote-written ones that localeCompare orders differently, so the second run's result also checks the block order. No run() warning appears.
- Cancelling a run once its kernel is up now stops the kernel: runtime-core's stop() fails the executing block and shuts the session down, so the run ends as stopped instead of keeping the kernel until the window closes. Overlapping stop() calls throw, so every caller shares one. - Runs pass the project's integrations to runtime-core, as the editor's agent cells do. - A body express.json() rejects, such as malformed JSON or one over the size limit, gets its 4xx and message instead of a logged 500. - The run store drops the oldest finished runs beyond 20, keeping unfinished runs and each notebook's newest successful run. - The README says that agent blocks need the provider's key in VS Code's environment, that a run outlives the closed preview until the window reloads or closes, and that a legacy multi-notebook file shows its split prompt on the first run.
Replace the hand-written FakeRunner and its recording array in the API tests with a ts-mockito mock of IAppPreviewRunner, as the notebook lookup and the unsupported-operation callback already are. startRun() stubs run() with a deferred outcome of its own, so a test settles the run it started instead of indexing into the runner's calls.
tkislan
force-pushed
the
tomaskislan/app-preview-runs
branch
from
November 18, 2026 15:52
b8f166d to
8fb1292
Compare
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.
@coderabbitai ignore
Summary
In the app preview, a page's
run(inputs)runs the workspace notebook that has that ID. The notebook runs headlessly in a new kernel on the toolkit server the extension runs for its.deepnotefile. The project's init notebook runs first, then the notebook with the page's input values. Polling the run returns Deepnote's run shape, sorun()resolves andresult()returns the notebook's JSON.Changes
POST /v2/runsandGET /v2/runs/:runId(appPreviewApi.node.ts).AppPreviewRunner(appPreviewRunner.node.ts). For each run it:@deepnote/runtime-core'sExecutionEngine, with the project's integrations.sortingKeyorder. runtime-core sorts withlocaleCompare, so the run's copy of the notebook is re-keyed first.success,error,internal_errororstopped.erroroutput. The run's error message is thereforeename: evalue, prefixed withInit notebook failed:when an init block fails.stopped.Testing
ExecutionEnginethat sorts and applies inputs like runtime-core 0.8.0. They cover:appPreviewgroup, against a real kernel:run()whoseresult()returns the notebook's JSON;ValueError: …and the outputs before it;run().localeComparewould reorder, so the test also checks the block order end to end.Notes
timeoutMsnever reaches the server. A notebook that never finishes keeps its kernel until the window reloads.OPENAI_API_KEY, is in VS Code's own environment. runtime-core 0.8.0 cannot take the key the extension stores.clear_outputandupdate_display_data, so a block that redraws its JSON reports its first version.