Skip to content

Run page generation in the background and show run status in the page list - #58

Merged
ruibaby merged 6 commits into
mainfrom
feat/background-agent-runs
Oct 26, 2026
Merged

ruibaby merged 6 commits into
mainfrom
feat/background-agent-runs

Conversation

@ruibaby

@ruibaby ruibaby commented Oct 26, 2026

Copy link
Copy Markdown
Member

Summary

Page generation no longer traps the user in the editor. Runs already execute on the server, so
the Console now treats them that way: creating a page can start generation and return to the
list, the list shows live run status with a stop action, and leaving the editor mid-run no
longer cancels the work.

Changes

Server

  • Add GET /pages/chat/runs (listActivePageChatRuns) returning the active runs from the
    coordinator: page name, session id, run id, status, start time and pending question.
  • Add POST /pages/{name}/chat/runs (startPageChatRun) to start a run without an SSE
    subscriber. It responds 204 only after the run is admitted, so the client can navigate
    away immediately and the run is already durably reserved.
  • Expose read-only run state via PageRun#summary and PageRunCoordinator#snapshot.

Console

  • The create panel starts the run on the server after creating the page and returns to the
    list; if the run cannot be started it falls back to the editor with the prompt preserved.
  • The page list polls active runs every 2 s and shows a status badge (generating / waiting for
    an answer / saving), with the pending question as its tooltip. Destructive card actions are
    disabled while a page is generating, and the action menu offers "Stop generation".
  • The list refreshes the affected card once a run disappears from the active set, so the new
    title, slug and thumbnail show up without a manual reload.
  • The editor gates navigation on admission instead of route identity: a run blocks leaving
    only until the server has reserved it, and leaving then reports that the assistant keeps
    generating in the background.
  • Reopening a page mid-run reattaches to the existing run and its live tool steps.
  • Regenerate the TypeScript client with generateApiClient for the new models and methods.

Notes

  • The active run list is in-process (the coordinator's map). After a plugin restart, or on
    another replica, the list is empty; checkpoint recovery still resumes the run when the page
    is reopened.
  • At most 4 concurrent runs are admitted; pending questions expire after 24 hours.
  • Thumbnails and committed content change only when a run commits, which is when the list
    refreshes the card.

Validation

  • bash gradlew test -x processUiResources: all backend tests pass.
  • pnpm --dir ui test:unit --run: 323 frontend tests pass, including new coverage for list
    stop, run badges, server-side start, admission retries and the post-run list refresh.
  • pnpm --dir ui type-check: passes.
  • CI=true bash gradlew build: BUILD SUCCESSFUL, plugin JAR packaged.
  • Manual end-to-end run on local Halo 2.26 with a real model: create and start in the
    background, two parallel runs, waiting-for-user, stop from the list, answer then leave,
    reopen mid-run with live tool steps, badge persists across a full reload, commit updates
    title/slug/thumbnail, and the list refreshes automatically when the run finishes.
  • pnpm --dir ui lint still reports pre-existing oxlint errors in spec files not touched by
    this change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T08:03:37.157484Z 3263fa8 Manual request
ℹ️ 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: b9e3aa5048

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

Comment thread ui/src/views/EditorView.vue Resolved

@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: e21a45d4d5

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

@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: b971378dea

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

Comment thread ui/src/composables/usePageListQuery.ts Resolved

@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: 9199792171

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

@ruibaby

ruibaby commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@ruibaby

ruibaby commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 3263fa8927

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

@ruibaby
ruibaby merged commit 2e473f6 into main Oct 26, 2026
1 check passed
@ruibaby
ruibaby deleted the feat/background-agent-runs branch October 26, 2026 08:37
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