Draft
Conversation
Contributor
Coverage report
Test suite run success3801 tests passing in 1450 suites. Report generated by 🧪jest coverage report action from a66594c |
36c6cde to
d8c3ef9
Compare
d8c3ef9 to
a66594c
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.

What
Add an append-only JSONL event log to
shopify app devthat external tools can tail for real-time session observability.Why
AI coding agents and other external tools need a machine-readable way to observe the dev session lifecycle — knowing when a session starts, when extensions are uploaded, when errors occur, and when the preview is ready. Currently this information is only available in human-readable terminal output, which is fragile to parse and lossy.
See below for an example agent skill that would use this flow.
How
DevSessionEventLog— append-only JSONL writer at.shopify/dev-session-events.jsonl, gitignored, truncated on eachdevstartDevSessionowns all event writes via awriteEvent()helper, subscribing toDevSessionStatusManagerevents for status transitionsinit()fails (permissions, disk), dev continues without loggingTesting
Checklist
📡 Agent Skill: dev-session-event-log
Overview
shopify app devwrites a machine-readable event log to.shopify/dev-session-events.jsonlin the app root directory (whereshopify.app.tomllives). The file is append-only JSONL (one JSON object per line), truncated on eachdevstart, and gitignored.The log covers session lifecycle events only. It does not include build tool output (webpack/esbuild), network proxy activity, or individual compilation steps.
Consuming the log
Event reference
Every event has a
ts(ISO 8601 timestamp) andeventfield. Additional fields vary by event type:session-startingstore,app_id,extension_countsession-createdpreview_url,graphiql_url,duration_mssession-updatedextensions_updated(string array of handles),duration_mssession-start-failedreason,error_count,duration_mschange-detectedextension_count,extensions[](each hashandle,type)bundle-uploadedduration_ms,extensions[](handle strings),inherited_countstatus-loadingmessage,is_ready,preview_urlstatus-successmessage,is_ready,preview_urlstatus-errormessage,is_ready,preview_urlremote-errorerrors[](each hasmessage,category),duration_msunknown-errorerrors[](each hasmessageonly),duration_msNotes:
bundle-uploadedis only emitted when assets need uploading. Config-only changes may skip it.status-*events are deduplicated — they only appear when the status message actually changes.Common patterns
Wait for session ready:
Watch for
session-created— thepreview_urlfield contains the URL to open.Detect and recover from errors:
status-errorwith message"Build error..."→ fix source code, wait for nextstatus-successremote-error→ readerrors[].messagefor the exact API validation error (e.g. invalid scopes)Typical successful startup:
Failed startup (terminal — process exits, must re-run
shopify app dev):Typical update cycle (file change):
Error and recovery:
Silent abort: If a new file change arrives while an update is in-flight, the in-progress update may be silently aborted. You'll see a new
change-detectedwithout a precedingsession-updatedfor the prior change.Example events
{"ts":"2026-03-04T19:13:41.502Z","event":"session-starting","store":"example.myshopify.com","app_id":"gid://shopify/App/123","extension_count":4} {"ts":"2026-03-04T19:13:42.246Z","event":"bundle-uploaded","duration_ms":741.31,"extensions":["app_access","webhooks","app_home","branding"],"inherited_count":0} {"ts":"2026-03-04T19:13:43.970Z","event":"session-created","preview_url":"https://admin.shopify.com/store/example/apps/abc123","graphiql_url":"http://localhost:3457/graphiql","duration_ms":2467.12} {"ts":"2026-03-04T19:13:43.978Z","event":"status-success","message":"Ready, watching for changes in your app","is_ready":true,"preview_url":"https://admin.shopify.com/store/example/apps/abc123"} {"ts":"2026-03-04T19:16:35.816Z","event":"change-detected","extension_count":1,"extensions":[{"handle":"admin-action","type":"created"}]} {"ts":"2026-03-04T19:35:38.123Z","event":"remote-error","errors":[{"message":"These scopes are invalid - [read_fake_scope]","category":"invalid"}]}