Skip to content

Defer Hermes task creation until the first message - #21

Merged
ribaricplusplus merged 3 commits into
mainfrom
feat/new-task-client-side-86cathhhk
Aug 18, 2026
Merged

Defer Hermes task creation until the first message#21
ribaricplusplus merged 3 commits into
mainfrom
feat/new-task-client-side-86cathhhk

Conversation

@ribaricplusplus

Copy link
Copy Markdown
Contributor

Summary

  • make New task open an ephemeral client-side Hermes draft instead of calling the API
  • persist the thread only when the first non-empty prompt or branch command is submitted
  • isolate draft messages, progress, typing, unread state, and selection from General and persisted tasks
  • guard rapid submission, null/error responses, and stale cross-DM persistence
  • add focused route tests plus a real compiled-Tauri offline acceptance harness

No backend or schema changes are included.

Acceptance evidence

Authoritative devbox commit: 7c376034e5c92a886ac10d2dfc8857a2d74030f3

Passed

pnpm --filter @thechat/desktop exec vitest run src/routes/dm.test.tsx
6 passed

pnpm --filter @thechat/desktop build
passed

THECHAT_NEW_TASK_E2E_ROOT=/home/dev/.cache/koda-work/86cathhhk-recovery/e2e/run-1 \
  pnpm test:e2e:new-task-client-side
1 compiled Tauri spec passed

The compiled-Tauri run:

  • started disposable PostgreSQL, Redis, and API resources
  • created a real Hermes DM with zero persisted task rows
  • loaded the real compiled desktop app through tauri-driver under Xvfb
  • stopped the API, PostgreSQL, and Redis before clicking New task
  • confirmed the local draft row and empty composer remained usable
  • observed zero browser fetches and zero WebSocket sends from the click
  • restarted PostgreSQL without restarting the API and confirmed task rows remained 0 -> 0
  • removed all E2E containers and processes after the run

Local review artifacts:

  • screenshot: /home/bruno/.cache/koda-work/86cathhhk-recovery/evidence/e2e-run-1/new-task-client-side.png
  • machine evidence: /home/bruno/.cache/koda-work/86cathhhk-recovery/evidence/e2e-run-1/ui-evidence.json
  • full run log: /home/bruno/.cache/koda-work/86cathhhk-recovery/logs/controller-e2e-run-1.log

Existing baseline failure

The normal desktop unit suite completed with 528 passed, 8 skipped, and one failure:

src/core/compaction.test.ts > isOverflow > accounts for model-specific maxOutputTokens

The exact same compaction assertion fails at untouched base commit 5fc0df1b55c92d7e489b616862c2a173111927b8. This PR does not touch compaction code or tests.

Reviewer commands

pnpm --filter @thechat/desktop exec vitest run src/routes/dm.test.tsx
pnpm --filter @thechat/desktop build
THECHAT_NEW_TASK_E2E_ROOT="$HOME/.cache/thechat-e2e/new-task-review" \
  pnpm test:e2e:new-task-client-side

The E2E command requires Docker, tauri-driver, and xvfb-run. It creates and removes dedicated containers named thechat-new-task-e2e-postgres and thechat-new-task-e2e-redis.

@ribaricplusplus
ribaricplusplus force-pushed the feat/new-task-client-side-86cathhhk branch from 07a2752 to 73b831e Compare August 7, 2026 08:22
@ribaricplusplus
ribaricplusplus force-pushed the feat/new-task-client-side-86cathhhk branch from 73b831e to f6db5e5 Compare August 17, 2026 08:22
@ribaricplusplus
ribaricplusplus merged commit 050a0fe into main Aug 18, 2026
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.

2 participants