Skip to content

Add a per-job lifecycle log and live status in the AI chat - #34

Merged
maun200 merged 2 commits into
mainfrom
feature/job-status-timeline
Nov 12, 2026
Merged

maun200 merged 2 commits into
mainfrom
feature/job-status-timeline

Conversation

@maun200

@maun200 maun200 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • GET /api/jobs/{id} now returns events (queued/claimed/requeued/completed/failed/cancelled, each timestamped and naming the worker where relevant) and available_workers (how many online, operator-approved workers could currently take this job's model/privacy).
  • Worker identity is resolved from id to display name at read time and only ever returned to the job's own owner.
  • The desktop app's AI chat renders this live under the pending answer (which machine is working on it, a retry after a failure, or that nobody is online for the chosen model yet) instead of a static "waiting..."/"computing..." label.

Why

Chat requests could sit queued indefinitely with no feedback when no worker served the requested model, and silent retries after a worker failure looked identical to a healthy run — both confusing from the requester's side.

Test plan

  • pytest -q (247 passed, 3 skipped)
  • ruff check --select E9,F63,F7,F82 .
  • New tests/test_job_events.py covers: initial queued event, available-worker counting (including trust/privacy filtering), claim→complete naming the worker, requeue-then-fail-for-good after repeated failures, cancellation, queue timeout, and worker revocation requeuing with an event.
  • Frontend script block syntax-checked with node --check.
  • Manual click-through in a browser (not done in this session — no GUI available in this environment; worth a quick look before/after merge).

🤖 Generated with Claude Code

https://claude.ai/code/session_014XvdYnanfEU1LisNWNpubA

Users had no visibility into what was actually happening with a pending
chat request beyond a static "waiting..."/"computing..." label, which was
confusing when a job sat queued because no worker served the chosen model,
or silently retried after a worker failure.

GET /api/jobs/{id} now returns `events` (queued/claimed/requeued/completed/
failed/cancelled, each timestamped and naming the worker where relevant)
and `available_workers` (online operator-approved workers for this job's
model/privacy). Worker identity is resolved from id to display name at read
time and only ever shown to the job's own owner. The desktop app's chat
renders this live under the pending answer instead of the old static label.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XvdYnanfEU1LisNWNpubA
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T21:54:17.730719Z 9fed45c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fed45c085

ℹ️ 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".

case"cancelled":return{text:t("evCancelled"),cls:""};
default:return{text:e.type,cls:""}}}
function renderPending(pendingStatus,pendingTimeline,s){
const lastWorker=[...s.events].reverse().find(e=>e.worker&&e.type!=="requeued"&&e.type!=="failed")?.worker;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep job polling compatible with older coordinators

When the desktop app is updated but its configured coordinator still returns the previous job-status response without events, spreading s.events throws before the response status is checked. The polling catch then reports an error and never displays even a completed answer. Default missing fields and fall back to the previous status labels so the client can keep polling older self-hosted servers.

Useful? React with 👍 / 👎.

The status line and timeline added for the job lifecycle log were purely
textual. Human feedback on a pending request benefits from something
visibly moving, not just changing words, so add a small 3-dot bounce
animation next to the status text while a job is queued or running,
honoring prefers-reduced-motion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XvdYnanfEU1LisNWNpubA
@maun200
maun200 merged commit 80c6bec into main Nov 12, 2026
14 checks passed
@maun200
maun200 deleted the feature/job-status-timeline branch November 12, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant