Repository navigation
fix(ui): start a chat private, and show reminder due dates - #5568
kovtcharov-amd merged 3 commits into
Conversation
A chat could only be made private after its first message, so that
message - often the sensitive one - was already saved to memory. The
new-chat screen now has a Private toggle; the session is created with
the flag, so the first turn already runs private.
Reminders on the Memory page showed only the words the user said
("next Friday"), which go stale. Each reminder now shows its stored
due date, and "Was due ..." once it has passed.
|
Verdict: Approve with suggestions The new-chat screen gets a Private toggle, so a chat is private from its very first message and that message is never saved to memory. Reminders on the Memory page now show their stored due date instead of only the user's relative wording. The logic is correct: the chat is created private before its first message is sent, the toggle resets after each chat, and the change is covered by frontend and backend tests. The docs are updated too. The one gap is proof on the screen the user actually touches. This changes the Agent UI, but the PR has no before→after screenshot of the Private chip or the "Due …" / "Was due …" labels. Please add one before merge; it doesn't block the code. Real-world evidenceN/A: no evidence bundle was produced for this run, and the change is Agent-UI-only, so the rendered screenshot is deferred to the strix-halo lane. The verdict rests on static review plus the PR's unit tests (vitest for the chip and due labels, pytest for 🔍 Technical detailsIssues 🟡 No Agent UI screenshot for a UI-visible change. The rubric asks for a Playwright before→after screenshot, embedded with a raw URL, for any Agent UI surface. Two views need one: the new-chat composer with Private on, and Memory → About you showing an upcoming and an overdue reminder. The new backend test does pin the route contract, so this is a nudge rather than a blocker. 🟢 The overdue style depends on the label's wording ( export function dueLabel(iso: string, now: Date = new Date()): { text: string; past: boolean } | nulland render 🟢 An explicit UTC timestamp can show as a timed reminder. Checked and fine
Strengths
|
|
Checked live in the Agent UI: the Private chip on the new-chat screen makes the first message private, and reminders show their due date. 🔍 Technical detailsWith Private on, sent "Please remember: my medical record number is MRN-55821 and I see my cardiologist on Mondays." Memory stayed at 9 entries with nothing matching MRN/cardiologist after extraction, and the chat header showed "Private chat on". Memory → About you → Reminders now reads "I'm interviewing at Contoso next Friday. · Due Fri, Oct 30" (https://raw.githubusercontent.com/kovtcharov/gaia/kalin/agent-ui-test-pass-evidence/agent-ui-test-pass/reminder-due-date.jpg). Same live build as #5567, DeepSeek V4 Flash on Fireworks. |
dueLabel now returns whether the reminder is past alongside the text, so the overdue style no longer depends on the label starting with Was.
|
An overdue reminder is now styled from its date, not from how the label is worded. Screenshots of the Private chip and of both due-date labels from the live Agent UI are in this comment. 🔍 Technical details
|
…5610) Four timing-sensitive unit tests failed 8 unrelated PRs this week (#5537, #5539, #5562, #5563, #5564, #5565, #5566, #5568) and one of main's last 11 completed runs. Each still guards the same bug, but no longer races the clock on a busy runner. Every rewritten test was checked by breaking the code: it fails on the real bug and passes 50/50 runs, including under full CPU load. The PR also keeps three tests out of the developer's real `~/.gaia`. ## Test plan - [x] `pytest tests/unit/mcp/client/test_stdio_hung_server.py tests/unit/test_file_lock.py tests/unit/test_mcp_bridge_concurrency.py tests/unit/chat/ui/test_agent_model_override.py tests/integration/test_folder_indexing.py -n 4`: 316 passed, 3 skipped - [x] The four de-flaked tests, run 50x each: 250/250 serial, and 250/250 under xdist (32 workers) with all 32 cores also running busy loops. Main's versions in that same loaded run: redaction failed 10/50. - [x] Each test fails when its bug is put back in the code (see details) - [x] `tests/integration/test_folder_indexing.py -n 4`, 5 runs: all pass. Main's version fails 7 to 9 tests per run. - [x] Test 841 passes with `GAIA_HOME` set to a temp dir. Main's version fails. - [x] Electron `npx jest`: 1098 passed. The one failure, `test_electron_chat_installer.js` (component size 103,725 > 102,400), also fails on main and is unrelated. - [ ] CI green on Linux, macOS and Windows unit lanes <details> <summary>🔍 Technical details</summary> **`test_redaction_stays_fast_on_dense_escapes`** (Linux, 2.01 to 2.03 s against a 2 s limit) - Cause: an absolute 2 s bound. Locally the worst text takes 0.19 s. On a 4-worker, coverage-traced runner it took about 10x that. - Fix: time one 1M-char text against eight 125K texts with the same total length, on the same machine. Linear code scores about 1.0 and a quadratic scan scores 8, so the test asserts < 3. It takes the best of up to three paired runs, and uses the lower of the wall-clock and CPU (`thread_time`) ratios. Contention inflates wall time, and Windows samples CPU time on ticks. The test also fails if the 1M text takes more than 15 s of CPU, which catches a per-position rescan: that is linear but takes minutes. - Break checks: a quadratic prefix copy in `_candidate_windows` (`len(text[:start].rstrip("\\"))`) gives a ratio of 5.9x and the test fails. Main's 2 s test passed that same regression locally (1.57 s). A per-anchor rescan without merging takes 56 s and hits the 15 s ceiling. **`test_children_of_an_exited_server_are_still_stopped`** (Linux) - Cause: the test slept a fixed 2 s for the child watcher. The watcher backs off (0.5, 1, 2, 4 s…), so on a slow start its next scan came after the launcher had exited and the child was never recorded. - Fix: poll until `child_pid in transport._children`, with a deadline of 3 × `_CHILD_SCAN_MAX_S`. - Break checks: never recording children fails with "never recorded". Clearing `_children` before stopping fails with "kept running". Delaying the watcher's first scan by 2.5 s reproduces the CI failure on main's test, and the new test passes. - Note for the product side: a launcher that spawns a child and exits inside a backoff window still orphans that child. Real `npx`/`uvx` launchers outlive the window. **`test_the_next_waiter_takes_the_lock_within_milliseconds`** (macOS, median 6.5 to 8.1 ms against 5 ms) - Cause: macOS stretches `sleep(0.001)` under load, and the 5 ms median left no headroom. - Fix: the test wraps `_poll_interval`, which records each interval and signals the moment the waiter starts a poll's sleep. The lock is released right then, so the whole interval stands between the waiter and the lock. - Assertions: every interval the front waiter asks for is ≤ 2 ms, and the median hand-off is < 15 ms. A 20 ms poll always waits at least 20 ms, so it fails the median even with the bound widened. - Break checks: `_NEXT_POLL_SECONDS = 0.02` or `0.1` fails the interval assertion. Sleeping `_POLL_SECONDS` directly, so `_poll_interval` is bypassed, fails the median (20.8 ms). **`test_a_dropped_idle_connection_is_logged[True]`** (Linux) - Cause: the test asserted that `"Traceback"` was absent from the stderr captured by `capsys`. The traceback in that run came from a fake Lemonade server that `test_lemonade_shared_server.py` left running on the same xdist worker (`BrokenPipeError`). - Fix: the `serve` fixture records the bridge server's own `handle_error` calls, and the test asserts that list is empty. socketserver calls `handle_error` before it closes the connection, so the check doesn't race. A plugin that writes a traceback to stderr during the test fails main's version and passes the new one. - Break check: making `log_error` also call the base `log_error`, and reverting `str(args[0])`, raises `TypeError` in the handler, and the test fails. **Isolation fixes** - `test_folder_indexing.py`: `temp_folder` now lives in `isolated_gaia_home`, a per-test fake home, so `ensure_within_home` still admits it. Parallel workers no longer share or delete `~/.gaia/test_temp`. - `test_issue_841…`: the test now sets `GAIA_HOME` itself, so an inherited value can't override the patched `Path.home`. - `tests/electron/setup.js`: `os.homedir()` points at a per-file temp dir. It is assigned rather than spied, so `jest.restoreAllMocks()` can't undo it. Setting `HOME` would not work, because Jest's sandboxed `process.env` never reaches `os.homedir()`. - The "Ignoring invalid agents section in …\.gaia\tray-config.json" log came from `crash-loop-notification.test.cjs`, which mocks `fs` with a config the validator rejects. The real file was never read, but the path now names the temp home. </details>

Before, a chat could only be made private after its first message, so that message (often the sensitive one, like "remember: my bank PIN hint is …") had already been saved to memory. Now the new-chat screen has a Private toggle next to the Ask and model chips, and the chat is created private, so nothing from its first turn is remembered. Reminders on the Memory page also showed only the user's own words ("next Friday"), which go stale within a week. They now show the stored date ("Due Fri, Oct 30") and switch to "Was due …" once it has passed.
Test plan
cd src/gaia/apps/webui && npx tsc --noEmit -p . && npx vitest run && npm run buildpython -m pytest tests/unit/chat -n 4🔍 Technical details
chatStore(draftPrivate), handled like the draft permission mode.startChatsends it inPOST /api/sessions(privatewas already part ofCreateSessionRequest) and resets it once the chat exists. The first message is queued only after the private session is in place, and every turn reads the flag from the session row. Nothing toggles it afterwards, so the first message cannot go out non-private. The chip is disabled while the chat is being created.privatefield. Privacy comes from the session row (_memory_mode→"private"for relayed sidecars), so no API change was needed. A new backend test pins that a session created withprivate: trueis private before any turn.dueLabel()treats a local-midnightdue_at, which is what a date-only reminder normalises to, as the whole day. That keeps it from reading "Was due" on the day itself. It shows the time for timed reminders and the year when it isn't the current one.due_at. Before, it restored the reminder without its date.ChatView.tsxis unchanged.