Title: feat(local-runner): run an agent block in the run-app demo by jamesbhobbs · Pull Request #421 · deepnote/deepnote · GitHub
Open Graph Title: feat(local-runner): run an agent block in the run-app demo by jamesbhobbs · Pull Request #421 · deepnote/deepnote
X Title: feat(local-runner): run an agent block in the run-app demo by jamesbhobbs · Pull Request #421 · deepnote/deepnote
Description: Chained on #419 — review that first; this diff is only the agent block on top of it. What and why The run-app executed Python live but contained zero agent blocks, so the only agent block a reader could actually see was the snapshot-viewer's precomputed one. You could read the agent support, but never watch it run. This adds a real agent block to local-runner-showcase.deepnote. It writes an executive readout from what the dashboard already computed, and both Run paths execute it for real. The one non-obvious design point The agent block runs last, and that ordering is load-bearing rather than cosmetic. The engine breaks at the first failing block (execution-engine.ts:425), so placed anywhere earlier a missing key would take the whole dashboard down with it. At the end, a keyless run still renders every dashboard block and reports the error on the agent block alone — the demo degrades to exactly one error card. deepnote_agent_model: auto is what lets one notebook serve both paths: locally it resolves to $OPENAI_MODEL (default gpt-5); in the cloud Deepnote picks the model. Verified end-to-end (not just typechecked) Path Credential Result Run (local kernel) OPENAI_API_KEY failedBlocks: 0; agent called add_code_block + add_markdown_block Run in cloud DEEPNOTE_TOKEN only run 4005cab5 success; no OpenAI key involved The cloud agent inserted a code block computing real month-over-month growth (North America +11.2%, Asia Pacific -2.2%) and a readout citing both the computed figures and the analyst_notes input — so notebook inputs reach the agent, not just the Python blocks. Also here serve.mjs now reads .env like deepnote run does (it previously did not — only the CLI loaded it), and prints which keys it found, so a missing key shows up at startup instead of mid-run: Run: OPENAI_API_KEY ✓ Run in cloud: DEEPNOTE_TOKEN ✓ READMEs updated: the showcase was documented as "deterministic and key-free", which is now true only of the dashboard, not the agent block. Two findings for reviewers (not fixed here) A unit test is environment-dependent. packages/cli/src/utils/run-in-cloud.test.ts > requires a token (missing) assumes the developer has no real token. run-in-cloud.ts:297 calls dotenv.config() on the cwd, so once you put a DEEPNOTE_TOKEN in .env — which this PR's README now tells you to do — the test fails and makes a live call to api.deepnote.com. Green in CI (no .env there); fails locally for anyone set up to use the cloud button. Worth a hermetic fix in its own PR. Local and cloud produce different artifacts for the same notebook. The agent block emits stream locally but display_data in the cloud, and the inserted block is markdown locally vs text-cell-p in the cloud. Both render fine in run-app, so nothing is broken — but anything that diffs a local snapshot against a cloud one would see it. 🤖 Generated with Claude Code Summary by CodeRabbit New Features Added an AI-generated executive readout to the showcase notebook, including regional growth rankings, key observations, and a recommendation based on computed dashboard values. Local app startup now loads environment settings from a working-directory .env file and reports credential availability. Documentation Clarified execution order and credential requirements for local and cloud runs. Documented that the dashboard renders without credentials, while the final AI readout requires appropriate configuration.
Open Graph Description: Chained on #419 — review that first; this diff is only the agent block on top of it. What and why The run-app executed Python live but contained zero agent blocks, so the only agent block a reader ...
X Description: Chained on #419 — review that first; this diff is only the agent block on top of it. What and why The run-app executed Python live but contained zero agent blocks, so the only agent block a reader ...
Opengraph URL: https://github.com/deepnote/deepnote/pull/421
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2f6a909c-cd72-f5a6-5339-e39530ded457 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C936:B3C94:114752B:169B7E1:6AED6644 |
| html-safe-nonce | f01f3e80f35f75d33763af3fe63252e1d8deb63b23bcc8a607804e5dbfd284be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTM2OkIzQzk0OjExNDc1MkI6MTY5QjdFMTo2QUVENjY0NCIsInZpc2l0b3JfaWQiOiIzOTkyNTE4MzkzNzU0MTE3NzAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1a62a2cd1b7179a11aedaea2cee7e10967b5417b1e9e3845a704695921803dd1 |
| hovercard-subject-tag | pull_request:4068027751 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/deepnote/deepnote/pull/421/files |
| twitter:image | https://avatars.githubusercontent.com/u/15235276?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/15235276?s=400&v=4 |
| og:image:alt | Chained on #419 — review that first; this diff is only the agent block on top of it. What and why The run-app executed Python live but contained zero agent blocks, so the only agent block a reader ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/deepnote/deepnote git https://github.com/deepnote/deepnote.git |
| octolytics-dimension-user_id | 45339858 |
| octolytics-dimension-user_login | deepnote |
| octolytics-dimension-repository_id | 1066509034 |
| octolytics-dimension-repository_nwo | deepnote/deepnote |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1066509034 |
| octolytics-dimension-repository_network_root_nwo | deepnote/deepnote |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width