Subagents (C4): the tree in the activity panel, read-only sessions, findings, stop; agent chats' setting
ci / ui (push) Waiting to run
ci / check (push) Failing after 3s
ci / start (push) Failing after 3s

On the server's /api/v2 (3.4.0, server dev 5d7b79c):
- The activity panel reads GET /chats/{chat}/tree beside the activity and
  draws ui/js/tree.js's rows in a Subagents section, the server panel's words
  and layout: nested by parent, position, phase, context %, state, model,
  mode + request options, messages and the last one, open slots, the ended
  ones folded and dimmed. A team's members are no longer drawn again among
  the tasks. The stream's `tree` frame redraws it.
- A subagent's conversation (/subagents/{id}/transcript, read again every 3 s
  while it works) and its findings open read-only in the panel; Stop asks,
  then POSTs /stop. With an agent chat's device away: the kept tree with the
  server's note, and its 409 sentence for the rest.
- A new agent chat's Subagents chip from /models?kind=agent&device= (each
  model's `subagents`, `agent_subagents.offered` and `device_runs`); an open
  agent chat's from its own `subagents`, as before.
- An approval item's `subagent` names it on the card.
- Progress keys are the spec's own ({{field}}), as the server's catalogues
  have them; SERVER_PENDING is gone, every sentence is translated.

tests/ui reads the server's contract fixtures (scripts/fetch-fixtures.sh ->
tests/ui/fixtures, SOURCE says the commit): status frames, tree, tree frame,
transcript, findings, models?kind=agent, a subagent's approval; six C4 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 10:44:35 +00:00
1 parent 89c769c806
commit 4b5b22c7d4
22 files changed
+1400 -181

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copy the server's /api/v2 contract fixtures that tests/ui reads into tests/ui/fixtures/:
#
# scripts/fetch-fixtures.sh <server-ref> (a tag such as v2.0.0-beta.8, or a branch)
#
# The server is a git checkout, LLeMbas beside this repository by default (LEMBAS_SERVER names
# another); the files are read from the ref, not from its working tree. SOURCE records the ref and
# the commit, so the tests say which server they hold the app to. CI has no server checkout: the
# copies are committed.
set -euo pipefail
cd "$(dirname "$0")/.."
SERVER="${LEMBAS_SERVER:-../LLeMbas}"
FROM="tests/fixtures/api_v2"
OUT="tests/ui/fixtures"
FILES="chat_agent.json event_ask.json event_status.json event_status_idle.json event_status_person.json
event_status_stopped.json event_tree.json models_agent.json subagent_findings.json subagent_transcript.json tree.json"
[ $# -eq 1 ] || { echo "usage: scripts/fetch-fixtures.sh <server-ref>" >&2; exit 2; }
commit="$(git -C "$SERVER" rev-parse --verify --quiet "$1^{commit}")" \
|| { echo "fetch-fixtures: $1 is not a commit in $SERVER" >&2; exit 1; }
mkdir -p "$OUT"
for f in $FILES; do
git -C "$SERVER" show "$commit:$FROM/$f" > "$OUT/$f" || { echo "fetch-fixtures: $f is not at $1" >&2; exit 1; }
done
printf 'LLeMbas %s (%s) %s\n' "$1" "$commit" "$FROM" > "$OUT/SOURCE"
echo "fetch-fixtures: $(echo $FILES | wc -w) files from LLeMbas $1 (${commit:0:12}) -> $OUT"
+32 -36
View File
@@ -399,42 +399,52 @@ KEYS = (
"Put the last command and its output into the message box",
"Sign in again: the server no longer accepts this app's sign-in.",
"The terminal needs a newer LLeMbas server. Ask its administrator to update it.",
)
# The progress line's sentences (ui/js/progress.js; harness spec 3.4.0, `loop.json`
# progress.texts, its `{{field}}` written as `%(field)s`). Shared with every client, so they
# are the server's to translate and never in OWN: until its catalogues have one, that sentence
# shows in English and this script says how many are waiting -- not a failure.
SERVER_PENDING = (
# progress.js (harness spec 3.4.0: loop.json progress.texts, keyed as the spec writes them)
"Queued",
"Queued: %(ahead)s ahead",
"Waiting for %(model)s: %(reason)s",
"Loading %(model)s",
"Reading the prompt: %(done)s / %(total)s tokens (%(percent)s%%)",
"Queued: {{ahead}} ahead",
"Waiting for {{model}}: {{reason}}",
"Loading {{model}}",
"Reading the prompt: {{done}} / {{total}} tokens ({{percent}}%)",
"Reading the prompt",
"Thinking",
"Writing: %(rate)s tok/s",
"Writing: {{rate}} tok/s",
"Writing",
"Running %(tool)s: %(what)s",
"Running %(tool)s",
"Waiting for you: %(what)s",
"Waiting for subagents: %(running)s running",
"Running {{tool}}: {{what}}",
"Running {{tool}}",
"Waiting for you: {{what}}",
"Waiting for subagents: {{running}} running",
"Compacting the conversation",
"Retrying in %(in)s s: %(reason)s",
"Retrying in {{in}} s: {{reason}}",
"Stopped",
"Stopped: %(reason)s",
"Failed: %(reason)s",
"Stopped: {{reason}}",
"Failed: {{reason}}",
"it serves one request at a time and is answering another",
"all its slots are in use",
"its server holds another model now",
"allow %(tool)s?",
"allow {{tool}}?",
"an approval",
"a question",
"the plan",
"by you",
"step limit",
"budget",
"%(text)s · %(elapsed)s",
# tree.js, activity.js (the subagent tree), chat.js (a subagent's approval)
"waiting for a slot",
"finished",
"idle",
"paused: context full",
"out of context",
"the main agent",
"%(size)s of %(max)s",
"Open slots: %(n)s",
"They run on the computer this chat runs on.",
"Ended",
"Context used",
"messages: %(n)s",
"findings: %(n)s",
"Findings",
"Stop %(name)s and the subagents under it?",
"This device is not linked right now.",
"Subagent %(name)s (%(id)s), %(position)s, asks:",
)
# The app's own sentences. The mode names (Manual, Edit, Auto, Plan) stay English, as the
@@ -2254,20 +2264,6 @@ def main() -> None:
ours = OWN.get(lang, {})
table: dict[str, str] = {}
from_server = 0
waiting = 0
for key in SERVER_PENDING:
if key in KEYS:
continue
text = theirs.get(key)
if not text:
waiting += 1
elif set(FIELD.findall(text)) != set(FIELD.findall(key)):
print(f"gen-i18n: {lang}: the fields of {text!r} do not match {key!r}", file=sys.stderr)
problems += 1
else:
table[key] = text
if waiting:
print(f"gen-i18n: {lang}: {waiting} progress sentences wait for the server's catalogue (English until then)")
for key in KEYS:
text = theirs.get(key)
if text: