Loading the documentation…

Developer inspector

The developer inspector lets Chrome DevTools attach to a running DataMind Oda app, so you can debug its host process and its connected browser clients from one DevTools window. It is development tooling for a source checkout rather than part of the everyday app, and it listens on this computer only.

For running, approving, stopping and removing dynamic packages, see Dynamic packages.

Turn the inspector on

The inspector joins one run through an overlay file. Nothing is installed into your profile, so a run started without the overlay has no inspector, and when the run stops, the inspector goes with it.

  1. Build the project first: pnpm run build. The overlay loads the inspector from the build output, and Building and shipping Oda covers building and running from source.
  2. Start the web mode with the overlay: oda --profile web --patch ./packages/experimental/inspector/cordis.patch.yml
  3. Open the devtools:// address the app logs once the inspector listens. Chrome DevTools attaches to the run and opens on the Elements panel.

In a source checkout, pnpm run demo:inspector starts the same web mode and loads the inspector from source instead of the build output.

What it serves

Once it listens, the inspector serves these addresses on one local port:

AddressWhat it answers
/json, /json/listThe DevTools discovery documents.
/json/versionThe version document for the protocol.
/devtools/page/<id>The target socket DevTools attaches to.
/ingestThe socket a browser client connects to as a source.

What you can inspect

A connected browser client advertises runtime, console and sources, with its sources read-only; its capability list leaves out the debugger and the heap profiler.

The Elements view

The inspector presents the app as one document with two fixed containers: <host> for the app's host side, and <clients> for the browser clients that connect to it.

Add your own data

A plugin publishes snapshots with ctx.inspector.publish(topic, payload), and a script reads the detached tree with ctx.inspector.cordis.getTree(). Neither call needs a DevTools window.

Fields and defaults

The inspector's fields live in its entry in the overlay you run. Set one there when a default does not fit:

FieldDefaultMeaning
host127.0.0.1The bind address; only a loopback address is accepted.
port9230The first port tried; a busy port steps up to the next free one, and 0 asks the operating system to assign one.
clientOriginsemptyExtra browser origins accepted by the ingest endpoint, given exactly; loopback origins are always accepted.
captureFetchonRecord the host's fetch calls after the inspector starts.
maxRequestBodyBytes8 MiBThe request-body prefix kept for each request.
maxResponseBodyBytes32 MiBThe response-body prefix kept for each request.
maxBodyChunkBytes48 KiBRaw bytes carried in one body record.
maxJournalBytes256 MiBTotal body bytes the inspector keeps.
maxRetainedRequests2000Active and completed requests kept.
maxSourceFrameBytes128 KiBThe largest encoded source frame.
startupTimeoutMs10 sHow long the start waits for the inspector to be ready.
stopTimeoutMs5 sThe window for a graceful shutdown before it is ended.
clientReconnectBaseMs250 msThe starting client reconnect backoff.
clientReconnectMaxMs5 sThe largest client reconnect backoff.
clientRuntimeTimeoutMs30 sDeadline for one runtime or sources command sent to a client.
queryTimeoutMs10 sDeadline for one non-DevTools query.

The same entry holds a few further bounds: maxSourceRecordsPerFrame 128, maxQueuedRecords 2048, maxQueuedBytes 16 MiB, maxClientRuntimeObjects 10000, maxClientRuntimeProperties 2000, maxClientSourceBytes 8 MiB, maxCordisNodes 2048 and maxDisconnectedCordisTrees 8.

Safety

Warning

While the inspector runs, anything attached to its DevTools socket can run code in the host and in any connected browser client. Stop the run when you are done.

Limits worth knowing

Messages you may see

MessageWhat it meansWhat to do
Inspector Client query socket is not connectedA query was sent while the client's socket was between connections. The query is refused rather than queued.Wait for the client to reconnect, then try again.
inspector: Client source is closedThe client side was already closed when it tried to update its state, as happens during teardown.Reload the page if the client should still be connected.
[inspector] Client source rejected: <message>The inspector refused a browser client as a source; the message carries the reason.Read the carried reason; the client closes that connection and retries with backoff, from 250 ms up to 5 s by default.
inspector protocol: Worker frame exceeds <n> bytesAn incoming frame was larger than the frame limit, so the connection closes and reconnects with backoff.If it repeats, the limit is too small for the data being sent; raise maxSourceFrameBytes in the overlay.
Client source result exceeds the source-frame byte limitA sources answer did not fit in one frame, so the inspector refused it.Read fewer sources at once, or raise maxSourceFrameBytes in the overlay.

Questions, answered

Do I need to install the inspector?

No. It joins one run through an overlay file; nothing is installed into your profile. A run started without the overlay has no inspector, and when that run stops, the inspector goes with it.

Can I run the inspector without building first?

No. The overlay loads the inspector from the build output, so build the project first. In a source checkout, pnpm run demo:inspector loads it from source instead.

What do I open once the inspector is running?

The devtools:// address the app logs once the inspector listens; opening it attaches Chrome DevTools to the run.

Which parts of Oda can I debug?

DevTools reaches the host side fully: console, sources, evaluation, breakpoints, pause and resume all work there. A connected browser client adds its console entries, evaluation and read-only sources; breakpoints, stepping and call frames are not supported in a client, and pause and resume never control one.

Can I debug several browser clients at once?

Yes. Every connected client joins as its own <client> entry, console entries merge from the host and from all of them, and evaluation goes to the client you select.

What happens to a client when it disconnects?

Its console context and live object handles are destroyed at once, and its tree stays as the last snapshot until it reconnects and sends a new one. Buffered observations are sent when it joins again. The inspector keeps up to eight disconnected trees.

Which requests does the Network panel miss?

The capture covers the host's fetch calls only. Direct low-level HTTP client calls and fetch references the app kept before the inspector started are not observed, and a client page's own requests are not captured.

Can I turn network capture off?

Yes. Set captureFetch to off in the overlay entry. Capture is on by default.

How much captured traffic does the inspector keep?

Up to maxRetainedRequests requests, 2000 by default, and maxJournalBytes of body bytes, 256 MiB by default. Each body is kept as a prefix and marked truncated past maxRequestBodyBytes or maxResponseBodyBytes; raise those fields in the overlay when a run needs more.

Can I add my own data to the inspector?

Yes. See Add your own data: a plugin publishes snapshots and a script reads the detached tree, with no DevTools window needed.

Can I reach the inspector from another computer?

No. Only a loopback address is accepted for the bind, and the client ingest socket additionally requires a random token, so nothing outside this computer can reach it.

Why did the inspector stop working mid-run?

The inspector's worker process exited. It does not restart the worker on its own, so that run loses the inspector; start the run again to get it back.