Skip to content

feat(assistant): add background tasks, global notifications and context exports - #164

Merged
TNT-Likely merged 15 commits into
mainfrom
codex/assistant-task-controls
Oct 1, 2026
Merged

TNT-Likely merged 15 commits into
mainfrom
codex/assistant-task-controls

Conversation

@TNT-Likely

@TNT-Likely TNT-Likely commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Background

Assistant work needed clearer controls, durable background visibility, readable mobile layouts, and a reusable summary when continuing a conversation elsewhere. Notifications were limited to assistant tasks and required opening a heavy modal. Conversation titles and export history also needed to remain useful as research accumulated.

Changes

Assistant task lifecycle and streaming

  • Add stop, conservative retry, progress, elapsed time, recovery actions, and restoration of the latest task after returning to a conversation.
  • Preserve task and message identity during retry; prevent replay after a tool invocation has begun and serialize approval decisions.
  • Discover background work without browser markers and reconcile interrupted tasks on server startup.
  • Restore the original application lifespan, prevent duplicate startup and schedulers, and initialize the first MiniRacer context before concurrent market data workers.
  • Memoize historical Markdown, batch live tokens, reduce durable SSE polling latency, and follow growing content while preserving the user's manual scroll position.
  • Remove display-only trailing whitespace during streaming and translate live tool labels.

Global notification center

  • Unify assistant outcomes and approvals, Agent reports, and price alerts into persisted notification events and receipts.
  • Keep read state independent of pending approvals. Add source/status filters, stable pagination, observed-ID read boundaries, archive protection, and source navigation.
  • Migrate legacy assistant notifications while preserving read/resolved state and suppressing historical toasts.
  • Use a lightweight bell preview for unread or pending items. Desktop hover opens the preview; mobile uses click. Hide the redundant global task indicator on the assistant page.

Conversation history and portable exports

  • Show running/queued/approval indicators in conversation history. Generate a bounded title after the first successful reply and support manual rename without overwriting it later.
  • Generate a Markdown context summary as a durable background job with HTTP 202 submission, status reads, resumable checkpoints, startup recovery, bounded model calls, and completion/failure notifications.
  • Export goals, constraints, facts, decisions, progress, unresolved questions, and next steps. Cover saved messages only and clearly identify snapshots captured during an active task.
  • Reduce duplicate supplemental facts and source metadata while preserving saved message content, dated evidence, and source links. Pack fragments according to the configured context budget.
  • Reuse identical snapshots, retry failed jobs from saved progress, and open the exact export from its notification.
  • Keep export history in each conversation's actions menu, with metadata-only pagination, status polling, detail preview, copy, and Markdown download.

Interface improvements

  • Use available mobile height and opaque conversation history surfaces.
  • Prioritize the assistant navigation entry on desktop and mobile.
  • Add a shared soft-face default avatar while preserving custom uploads and falling back when an uploaded image cannot load.

Validation

  • Backend: pytest tests/ -x -q -rs, using a temporary SQLite engine/session factory before collection to protect the development database: 885 passed, 3 skipped, with four consecutive full-suite passes after the SSE fixture correction.
  • Market data package: pytest packages/marketdata/tests -q: 188 passed.
  • Agent runtime package: pytest packages/pan-agent-runtime/tests -q: 43 passed.
  • Frontend: cd frontend && pnpm exec vitest run: 177 passed across 41 files.
  • Frontend: pnpm run check:i18n: passed for 126 migrated files.
  • Frontend: pnpm run build: TypeScript and Vite build passed.
  • git diff --check: passed.
  • Add 19 backend export cases and 8 frontend export/avatar/API cases covering input contracts, model-output validation, snapshot reuse, metadata history, worker deduplication, exact notification targets, checkpoint retry/recovery, shutdown, deletion, transaction rollback, HTTP 202, polling cleanup, and StrictMode submission.
  • Fix an existing log-SSE test fixture that shared one native SQLite connection across a reader thread and a writer. Use separate connections and an explicit baseline-read signal; the targeted 5-test suite passes.
  • Previously recorded browser checks covered task controls/background navigation, opaque mobile history, responsive composer height, notification routing, title/rename, and controlled streaming/scroll fixtures. The latest export/history/avatar changes were verified by isolated automated tests and build; no new real-provider or physical-device validation is claimed.

Boundaries and risks

  • Task execution and export workers remain single-process asyncio implementations. Assistant retries remain conservative around tool side effects; exports perform read-only model summarization and can resume saved progress.
  • Notifications use the existing shared-installation authentication model. They are an in-app inbox, without OS push or per-user/tenant delivery.
  • Export content is sent to the configured summary model. Model quality and real-provider latency were not re-evaluated in this merge check. Saved snapshots and history are deleted with their conversation.
  • Exports retain sequential rolling summarization, bounded per-call/job timeouts, and a 32-part limit. Large conversations can require multiple model calls.
  • Local checks use Python 3.13 and Node 20.20.2; the release workflow uses Python 3.11 and the Docker frontend build uses Node 24.14.0. Local builds pass with the existing Node engine and chunk-size warnings.
  • Three local skips cover an unavailable optional OpenTelemetry SDK and two Windows-only checks. Existing Pydantic/Starlette deprecation warnings remain.
  • Local .docs/ records and AGENTS.md are excluded from this pull request.

Follow-up

  • Verify provider summary quality and latency during user acceptance, and verify keyboard/scroll behavior on physical mobile devices.
  • Introduce durable worker leases, idempotent tool contracts, and explicit multiworker ownership before extending task recovery across external side effects or multiple processes.

@TNT-Likely TNT-Likely changed the title feat(assistant): add task controls and recovery actions feat(assistant): add controllable background tasks and notifications Sep 30, 2026
@TNT-Likely TNT-Likely changed the title feat(assistant): add controllable background tasks and notifications feat(assistant): add background tasks, global notifications and context exports Oct 1, 2026
@TNT-Likely
TNT-Likely merged commit 6617dde into main Oct 1, 2026
1 check passed
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