Commit 1cbebcb
Release 2.4.2: Context enrichment cache auto-population (#669)
* Bump version to 2.4.2
Known issues to fix in this release:
1. Wallet badge does not recalculate after trust finalizes at 5/5 (stays 1/5 amber)
2. Music Assistant devices not detected - needs robust detection + dedicated UI page for troubleshooting/configuring HA/MA when HA adapter is loaded
3. Depth limit violated via repeated pondering (7 round limit not enforced)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix wallet badge, Music Assistant detection, and depth limit enforcement
Bug fixes for v2.4.2:
1. Wallet badge stays amber after trust level change
- InteractViewModel.kt: Call fetchWalletStatus() when trust level changes
- Badge color depends on spending authority which changes with trust level
2. Music Assistant tools not detected
- tool_service.py: Add notify_ha_initialized() method for post-init MA detection
- adapter.py: Call notify_ha_initialized() after background HA initialization
- Fixes race condition where tool discovery ran before HA entities loaded
3. Depth limit (7 rounds) not enforced
- component_builder.py: Add bypass_exemption=True to ThoughtDepthGuardrail
- Guardrail must always run to enforce hard safety limit
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add Environment Info page and fix lat/long passthrough in setup
Features:
1. New Environment Information page under Adapters & Tools menu
- Shows user location from setup (lat/long, timezone, city)
- Displays context enrichment results from all adapters
- Shows cache statistics for debugging
- Highlights missing coordinates that break weather/nav
2. Fix lat/long not passed to backend during first-run setup
- Add location_latitude/longitude fields to CompleteSetupRequest model
- Extract coordinates from selectedLocation in SetupViewModel
- Include timezone from selected location
3. Backend API endpoint: GET /v1/system/environment
- Returns location info from env vars
- Returns context enrichment cache data
- Returns cache statistics
Files changed:
- services.py: Add /v1/system/environment endpoint
- system_snapshot_helpers.py: Add get_all_entries() to cache
- Setup.kt: Add location_latitude/longitude to CompleteSetupRequest
- SetupViewModel.kt: Extract lat/long/timezone from selectedLocation
- CIRISApp.kt: Add EnvironmentInfo screen and menu item
- CIRISApiClient.kt: Add getEnvironmentInfo() method
- CIRISApiClientProtocol.kt: Add interface and data classes
- EnvironmentInfoScreen.kt: New UI screen (created)
- EnvironmentInfoViewModel.kt: New ViewModel (created)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add Environment Items shopping list UI with CRUD
Backend changes:
- Add GET /v1/system/adapters/context-enrichment endpoint for adapter cache
- Add location fields to SetupConfigResponse (from .env)
- Remove redundant /v1/system/environment endpoint
Mobile changes:
- Shopping list style Environment Info screen with category filters
- Categories: Want, Need, Have, Can Borrow, Can Barter
- Item cards with quantity, condition, and notes
- Add/Delete item dialogs
- Grayed-out community share toggles (coming soon)
- Context enrichment display with cache stats
- Uses existing /memory/query API for ENVIRONMENT scope nodes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add context enrichment cache auto-population and unit tests
- Auto-populate enrichment cache at startup and when adapters load
- Fix 404 on /adapters/context-enrichment route ordering
- Add comprehensive tests for startup cache and adapter refresh
- Update changelog for 2.4.1 and 2.4.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Address Codex feedback on environment items and config
- Fix NodeType: use "concept" instead of invalid "object"
- Fix delete scope: add scope query param to forget endpoint, pass scope=environment from mobile
- Fix location parsing: wrap float() in try/except to handle invalid env vars
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add unit tests for Codex feedback fixes
- Test forget endpoint with environment/community/local scope params
- Test location env var parsing with valid/invalid/empty values
- 9 new tests covering all three Codex-identified issues
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix SonarCloud S5765: Store asyncio task to prevent GC
Store background task in _background_tasks set and add done callback
to remove completed tasks. Prevents premature garbage collection.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix conscience prompt localization when user changes language
- Add set_conscience_prompt_language() call in sync_language_preference()
to update conscience prompts when user changes preferred_language via API
- Update streaming localization test to check DMA prompts instead of
conscience prompts (conscience prompts aren't streamed in SSE events)
- Add unit test for conscience prompt loader sync
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix SonarCloud issues: FastAPI Annotated hints and cognitive complexity
- memory.py: Use Annotated type hints for Path/Query parameters (S5765)
- config.py: Extract helper functions to reduce cognitive complexity
from 19 to ~10: _require_auth_if_configured, _get_template_id,
_parse_float_env
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 58debb7 commit 1cbebcb
File tree
33 files changed
+2352
-99
lines changed- android/app/src/main/python
- ciris_adapters/home_assistant
- ciris_engine
- logic
- adapters/api/routes
- setup
- system
- context
- runtime
- utils
- ios/CirisiOS/src/ciris_ios
- mobile
- androidApp
- src/main/python
- iosApp/iosApp
- tests
- adapters/api
- ciris_engine/logic
- context
- utils
- logic/runtime
- tools/qa_runner/modules
33 files changed
+2352
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
8 | 33 | | |
9 | 34 | | |
10 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
1301 | 1315 | | |
1302 | 1316 | | |
1303 | 1317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
450 | 460 | | |
451 | 461 | | |
452 | 462 | | |
453 | | - | |
| 463 | + | |
454 | 464 | | |
455 | 465 | | |
456 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
290 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
291 | 286 | | |
292 | | - | |
293 | | - | |
| 287 | + | |
| 288 | + | |
294 | 289 | | |
295 | 290 | | |
296 | 291 | | |
297 | 292 | | |
298 | 293 | | |
299 | | - | |
300 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
301 | 316 | | |
302 | | - | |
| 317 | + | |
303 | 318 | | |
| 319 | + | |
| 320 | + | |
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
| |||
313 | 330 | | |
314 | 331 | | |
315 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
316 | 340 | | |
317 | 341 | | |
318 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
381 | 390 | | |
382 | 391 | | |
383 | 392 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
716 | 755 | | |
717 | 756 | | |
718 | 757 | | |
| |||
964 | 1003 | | |
965 | 1004 | | |
966 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
0 commit comments