Conversation
When a build completes (CLI or UI), a .build_complete sentinel file is written. The chat page polls this file every 5 seconds and, when a newer build is detected, shows a toast and an amber warning banner above the chat input with a one-click Reload action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a build-completion “fingerprint” and UI polling so an open chat can detect when a new context build finishes and prompt the user to reload (avoiding stale context).
Changes:
- Write a
.build_completesentinel file after successful builds (CLI + UI build paths). - Introduce
get_build_fingerprint()(sentinel mtime) and store the initial fingerprint in Streamlit session state at agent init. - Add a Streamlit fragment in chat UI to poll for a newer fingerprint and display a toast + inline reload banner; add unit tests for fingerprint behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/databao_cli/ui/services/dce_operations.py |
Writes a build-complete sentinel after UI build operations. |
src/databao_cli/commands/build.py |
Writes the sentinel after CLI builds complete. |
src/databao_cli/ui/project_utils.py |
Adds get_build_fingerprint() based on sentinel mtime. |
src/databao_cli/ui/app.py |
Captures fingerprint at agent init; initializes related session state keys. |
src/databao_cli/ui/components/chat.py |
Adds polling fragment and reload banner/cta in chat UI. |
tests/test_build_fingerprint.py |
Tests fingerprint detection and change behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use os.utime instead of time.sleep to advance sentinel mtime in test - When build_fingerprint is 0.0 (no build at init), silently adopt the first completed build so subsequent builds are still detected Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move BUILD_SENTINEL + write_build_sentinel to project/layout.py so CLI build command doesn't depend on UI service module - Use invalidate_agent() in reload handler instead of duplicating reset - Clear new_build_available on agent init to prevent stale banner after sidebar reload Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
When a new build completes while the user has a chat open, they are not notified and may continue chatting against stale context. This adds a non-blocking notification banner in the chat UI that detects new builds and offers a one-click reload.
Changes
Build sentinel file
Both the CLI and UI build paths now write a
.build_completesentinel file after a successful build, providing a reliable signal that a build has finished.Files
src/databao_cli/commands/build.pysrc/databao_cli/ui/services/dce_operations.pyBuild fingerprint detection
A new
get_build_fingerprint()function reads the sentinel file's mtime to determine the last completed build. The fingerprint is captured in session state at agent init.Files
src/databao_cli/ui/project_utils.pysrc/databao_cli/ui/app.pyNew-build notification fragment
A Streamlit fragment polls the sentinel every 5 seconds. When a newer build is detected, it shows a toast notification and renders an amber warning banner above the chat input with a Reload button.
Files
src/databao_cli/ui/components/chat.pyUnit tests
Tests for build fingerprint detection covering missing domain, missing sentinel, stable reads, and change detection.
Files
tests/test_build_fingerprint.pyTest Plan
databao buildin a separate terminalmake test— all tests passmake check— lint and type checks pass