Make coder-lite --dev tolerate an already-running dev server.

6d10d5a29cd8 · AtlantisPleb · · parent ddb75aa8b9d3

Make coder-lite --dev tolerate an already-running dev server.

- Detect the dev server by TCP connect to 127.0.0.1:4000 instead of a
  reqwest health check, so an existing server is reused immediately.
- Drop the direct reqwest dependency from coder-lite; runtime uses
  openresponses-rust for streaming.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified Cargo.lock
  • modified crates/coder-lite/Cargo.toml
  • modified crates/coder-lite/src/main.rs

Diff

3 files changed, +5 -13

Cargo.lock modified -1

@@ -383,7 +383,6 @@ dependencies = [

383 383
 "futures",
384 384
 "openresponses-rust",
385 385
 "ratatui",
386
 "reqwest 0.12.28",
387 386
 "tokio",
388 387
]
389 388
crates/coder-lite/Cargo.toml modified -1

@@ -14,5 +14,4 @@ tokio = { version = "1", features = ["full"] }

14 14
crossterm = { version = "0.28", features = ["event-stream"] }
15 15
ratatui = { version = "0.29", default-features = false, features = ["crossterm"] }
16 16
openresponses-rust = "2026.7.26"
17
reqwest = { workspace = true }
18 17
futures = "0.3"
crates/coder-lite/src/main.rs modified +5 -11

@@ -3,8 +3,9 @@

3 3
use std::env;
4 4
use std::path::PathBuf;
5 5
use std::time::Duration;
6
use tokio::net::TcpStream;
6 7
use tokio::process::Command;
7
use tokio::time::sleep;
8
use tokio::time::{sleep, timeout};
8 9
9 10
const DEV_BASE_URL: &str = "http://localhost:4000/api/v1";
10 11
const DEV_API_KEY: &str = "fake";

@@ -51,16 +52,9 @@ async fn boot_dev_server() -> Result<(), Box<dyn std::error::Error>> {

51 52
}
52 53
53 54
async fn is_dev_server_up() -> bool {
54
    let client = reqwest::Client::builder()
55
        .timeout(Duration::from_secs(2))
56
        .build()
57
        .unwrap_or_default();
58
    let url = format!("{}/health", DEV_BASE_URL);
59
    if let Ok(resp) = client.get(&url).send().await {
60
        resp.status().is_success()
61
    } else {
62
        false
63
    }
55
    timeout(Duration::from_secs(2), TcpStream::connect("127.0.0.1:4000"))
56
        .await
57
        .is_ok()
64 58
}
65 59
66 60
fn web_repo() -> Result<PathBuf, Box<dyn std::error::Error>> {

This page updates live while a promote is in flight · changelog