Repository navigation
Mark dev servers live only once a declared readiness probe passes - #1689
Conversation
solenta.json can declare devServer.ready as a tcp port, a localhost http URL, or an exec command. The logged URL is withheld until the probe passes, so the Browser pane no longer auto-loads a server that is not up yet. The Dev server card shows the probe state. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de5d047e2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // A declared probe gates the URL: the Browser pane auto-loads it. | ||
| if (rec.url && (!rec.probe || rec.probe.status === "ready")) state.url = rec.url; | ||
| if (rec.probe) state.probe = { ...rec.probe }; |
There was a problem hiding this comment.
Prevent server discovery from bypassing readiness gates
When an HTTP or exec probe remains pending after the process opens a port, withholding only state.url does not stop the Browser pane from loading it. BrowserPane.pickSuggestedUrl falls back to listLocalServers, which retains every non-ephemeral listener under the project root, and the pane auto-navigates to that result. Thus, opening the Browser pane after a server begins listening can load it while its declared probe is still waiting or failed; the pending probe must also suppress the discovered-server fallback for this managed server.
Useful? React with 👍 / 👎.
| if (why === null) { | ||
| state.status = "ready"; | ||
| state.readyAt = Date.now(); | ||
| delete state.lastError; | ||
| return; |
There was a problem hiding this comment.
Reject probe success that arrives after timeoutMs
If an attempt succeeds after the configured deadline, this branch marks the probe ready without checking elapsed time. For example, { "exec": "sleep 2", "timeoutMs": 1000 } starts its first attempt after the polling delay, runs with the fixed 5-second attempt timeout, and is accepted around 2.5 seconds instead of failing at one second; slow HTTP successes behave similarly. Check the deadline before accepting success and cap each attempt by the remaining total timeout.
Useful? React with 👍 / 👎.
| env: ctx.env, | ||
| project: ctx.project, |
There was a problem hiding this comment.
Preserve lane overrides in exec probe environments
For an exec probe, passing both ctx.env and the original project causes runVerifyCommand to spread project.env after input.env, overwriting the lane-specific values already used to launch the server. If project configuration sets PORT=3000 and a claimed lane overrides it to 3001, the server runs on 3001 but an exec probe such as curl localhost:$PORT/health tests 3000. Ensure the probe command receives the exact effective dev-server environment without reapplying lower-precedence project values.
Useful? React with 👍 / 👎.
docs.html gained the readiness-probe paragraph in #1689 without a rebuild, so site-llms.test.js failed on main and on every PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#272) (#1699) * coder-checkpoint: turn 70 Solenta-Message-Id: 11966517-c619-42ad-a3b4-d2b5bfe76d8b * coder-checkpoint: turn 71 Solenta-Message-Id: adc9fdbc-6b99-4514-a298-2ac7372c41fb * Regenerate llms-full.txt for the dev server readiness docs docs.html gained the readiness-probe paragraph in #1689 without a rebuild, so site-llms.test.js failed on main and on every PR. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Stop the replay test crashing on a log it reads mid-write replay.js polls replay.log while the fake CLI appends to it. An empty file or a half-written last line threw "Unexpected end of JSON input" on macOS CI instead of reading as not-done-yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Solenta <solenta@local> Co-authored-by: Willem <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Until now a thread's dev server counted as live as soon as a URL showed up in its log, and the Browser pane auto-loaded it, often before the server could actually serve. Projects can now declare a readiness probe in
solenta.json. The URL is offered only once the probe passes. Closes #282.{ "devServer": { "ready": { "tcp": "$PORT" } } }Changes
devServer.readytakes exactly one oftcp(a port),http(a localhost URL that must answer 2xx/3xx) orexec(a command that must exit 0). There's an optionaltimeoutMs, default 120s.$PORTand other variables expand from the dev server's own env, so each lane probes its own port.devserver:status, so the Browser pane waits. Projects with no probe behave exactly as before.Waiting for tcp localhost:5173 (ECONNREFUSED),Ready tcp localhost:5173, orNot ready: <error>. On timeout the server keeps running; only the probe is marked failed.site/docs.htmldocuments the key.Verification
electron/test/devservers.test.js: parser units, plus real-process integration for tcp (URL hidden, then shown once the port listens), exec (file flag), http (a 503 times out to failed), and an unset$VARfailing at start. All pass.test/devServer.test.tsx: the card's waiting, failed and ready lines. Passes.tsc --noEmitis clean.test:electronin a CI-like clean env: the only failures are in 7 codex/guardrail/orch-server/mcp files. On that subset, a clean HEAD checkout and this branch fail the identical 28 tests.Notes for reviewers
execprobes skip thesolenta.jsonapproval prompt. They only run after the user clicks Start on one of the repo'snpmscripts, which already runs code from the repo. Say so if you'd rather gate them anyway.httpprobes are restricted to loopback hosts, so a checked-in file can't make the app fetch arbitrary URLs.solenta.jsonisn't valid JSON, no probe runs and behaviour is unchanged. A valid file with a baddevServer.readyfails the probe immediately and shows why.🤖 Generated with Claude Code