Read-only mirror of github.com/ondeinference/ed.
Mirrored from https://github.com/ondeinference/ed.git
Synced Nov 23, 01:00 UTC
web-chat: keep caller RUSTFLAGS, report early messages, mark failed replies
build.sh now appends +simd128 to an exported RUSTFLAGS instead of dropping it. The worker answers a message that arrives before Ed has started with an error instead of ignoring it. A reply that fails after some tokens streamed keeps its text and gets the error appended. The onde comment in Cargo.toml now says the dependency waits on ondeinference/onde#50 rather than on a version number. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
Seto Elkahfi committed
Nov 16, 2026 at 13:50 UTC
c196d65f32112f47d4c3a698db36c6a220d5afd2
4 files changed
+10
-4
examples/web-chat/Cargo.toml
+3
-1
@@ -13,7 +13,9 @@ crate-type = ["cdylib"]
13
[dependencies]
14
ed-agent = { path = "../../crates/ed-agent" }
15
# Used only for web_store::download_model; ed-agent does not re-export it. The
16
-# browser engine needs an onde release that has it (1.5.0).
16
+# browser engine and web_store are in ondeinference/onde#50 and not released
17
+# yet, so this does not build from crates.io until a release has them. Raise
18
+# the requirement to that release when it is out.
19
onde = "1.4.0"
20
wasm-bindgen = "0.2"
21
wasm-bindgen-futures = "0.4"
examples/web-chat/build.sh
+1
-1
@@ -8,6 +8,6 @@ cd "$(dirname "$0")"
8
9
# simd128 is what makes CPU inference usable in a browser. Every current
10
# browser supports it, and main.js checks for it before loading anything.
11
-export RUSTFLAGS="${RUSTFLAGS:--C target-feature=+simd128}"
11
+export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C target-feature=+simd128"
12
13
wasm-pack build --target web --release --out-dir www/pkg --no-typescript -- "$@"
examples/web-chat/www/main.js
+4
-1
@@ -163,7 +163,10 @@ function onError(m) {
163
if (current) {
164
current.bubble.classList.remove("pending");
165
current.bubble.classList.add("error");
166
- current.bubble.textContent ||= `Error: ${m.message}`;
166
+ const note = `Error: ${m.message}`;
167
+ current.bubble.textContent = current.bubble.textContent
168
+ ? `${current.bubble.textContent}\n\n[${note}]`
169
+ : note;
170
current = null;
171
setBusy(false);
172
} else if (m.stage === "boot") {
examples/web-chat/www/worker.js
+2
-1
@@ -63,7 +63,8 @@ const handlers = {
63
64
self.onmessage = async ({ data }) => {
65
const handler = handlers[data.type];
66
- if (!handler || !chat) return;
66
+ if (!handler) return;
67
+ if (!chat) return fail(data.type, "Ed is still starting", data.id);
68
try {
69
await handler(data);
70
} catch (error) {