Skip to content

Commit b13a760

Browse files
emooreatxclaude
andauthored
Release 1.6.6: Ally template, deferral UI fix, setup display name fix (#520)
* Release v1.6.5.3: Fix setup wizard database path resolution and PostgreSQL support This patch release fixes critical database path resolution issues in the setup wizard that prevented users from persisting correctly in both SQLite and PostgreSQL deployments. ### Changes - **Fixed setup wizard database path bug** - Users created during setup now persist correctly - Modified `_create_setup_users()` to accept `auth_db_path` parameter from running application - Previously created new `EssentialConfig()` which defaulted to CWD-relative paths - Now uses runtime's resolved database path ensuring consistency - **Fixed central path resolution in EssentialConfig** - All database paths now use centralized path_resolution.py - Added `default_factory` functions that call `get_data_dir()` - Ensures correct paths across all three deployment modes: - Managed/Docker mode: `/app/data/` - Development mode: `<git_repo>/data/` - Installed mode: `~/ciris/data/` - **Fixed PostgreSQL backend support in setup wizard** - Uses `get_audit_db_full_path()` - Setup wizard now correctly creates users in PostgreSQL when configured - Previously only worked with SQLite deployments - Matches the database resolution logic used by AuthenticationService - **Fixed test suite** - Updated test signatures and fixtures - Added `client_with_runtime` fixture for proper runtime mocking - Updated 4 tests to match new `_create_setup_users()` signature - All tests passing (6,675 passed, 38 skipped) ### Version - Bumped to 1.6.5.3-stable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add UI fields to PendingDeferral schema for issue #514 Add three UI compatibility fields directly to the PendingDeferral schema: - question: Optional display text for UI (defaults to None) - context: Additional context as JSONDict (defaults to empty dict) - timeout_at: ISO format timeout string (defaults to None) Simplify API route by removing transformation code - the schema now includes these fields natively, eliminating the need for runtime transformation. This fixes deferral details not being visible in the UI by ensuring the TypeScript SDK receives the expected fields from the API. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Use actual username in /auth/me endpoint for issue #515 The /auth/me endpoint was returning the wa-date format user_id (e.g., "wa-2025-11-24-03-40-04-427473") as the username, which was displayed in the setup wizard's welcome message. This fix fetches the actual username from the auth service. Changes: - Modified get_current_user() to inject auth_service dependency - Fetch user object via auth_service.get_user(auth.user_id) - Use user.name if available, fallback to auth.user_id if not found - Maintains type safety (mypy passes) Fixes #515 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add Ally personal assistant template and consolidate templates folder This commit introduces the Ally agent template and consolidates all templates to a single authoritative location for improved maintainability. Changes: - Add new Ally template (personal thriving assistant) - Evidence-based ethics (Google DeepMind 2024 autonomy principles) - California SB 243 compliant crisis response - TaskSchedulerService integration for reminders and goal tracking - Comprehensive SOPs for personal assistance, decision support, and crisis handling - Consolidate templates to single location - Remove root /ciris_templates/ folder (9 files) - Keep only ciris_engine/ciris_templates/ as authoritative source - Update generate_manifest.py to use consolidated path - Update signed manifest - All 7 production templates signed with Ed25519 - Manifest includes Ally with checksum sha256:381e5e96e5a6612d0f3ff225c20101c431e832c4dbe2dd04c00302a070001f8c - Root signature: Sr4Fc4KRLFieAaFy6zkCogl62nG93bzfAtzcYpdQa+K7FmmVPHnSustmM4LQ+5ZFRq+21Ms0SwJSc+Yr6gObCg== Verification: - Path resolution works correctly with consolidated folder - All templates load and validate successfully - Manifest signing tool updated and tested 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Populate UI fields in WiseAuthorityService.get_pending_deferrals The PendingDeferral schema was updated with question, context, and timeout_at fields, but the service method wasn't populating them. This caused the UI to continue showing empty values. Changes: - Populate question field from reason (for UI display) - Build rich context from deferral data including: - task_description: Full task description (up to 500 chars) - Any context fields from deferral_info (user_id, etc.) - original_message if available - Calculate timeout_at as created_at + 7 days (ISO format) This completes the fix for issue #514 - deferral details now visible in UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Update tools/generate_template_manifest.py for consolidated templates Address PR review comment - update the unified manifest generator to: - Add ally template to TEMPLATES dict - Point to consolidated ciris_engine/ciris_templates path This ensures both manifest generators (tools/generate_template_manifest.py and tools/templates/generate_manifest.py) are in sync with the template consolidation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: Bump version to 1.6.6 Release 1.6.6 includes: - PR #517: Fix deferral UI fields (issue #514) - PR #518: Fix setup display name (issue #515) - PR #519: Add Ally personal assistant template + consolidate templates folder 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: PostgreSQL dialect extract_scalar odict_keys subscript error Convert keys() result to list before indexing since dict_keys/odict_keys view objects don't support subscripting with [0]. Fixes #521 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Change DEBUG info logged at INFO level to DEBUG level Reduces log noise in production by moving debug-level messages from INFO to DEBUG level across multiple files: - graph.py: add_graph_node debug messages - memory_service.py: LocalGraphMemoryService init debug - audit_service/service.py: audit entry creation debug - action_dispatcher.py: tool audit parameter debug - wakeup_processor.py: wakeup step processing debug - setup.py: auth database path debug - audit.py routes: audit entry conversion debug - mock_llm responses: message processing debug - main.py: exit point tracking debug 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: Reduce cognitive complexity in get_pending_deferrals Extract helper methods to reduce cognitive complexity from 24 to ~10: - _parse_deferral_context: Parse context JSON and extract deferral info - _priority_to_string: Convert integer priority to string representation - _build_ui_context: Build UI context dictionary from deferral data - _create_pending_deferral: Create PendingDeferral from parsed data Added 19 unit tests covering all helper methods with edge cases: - JSON parsing (valid, invalid, None, missing keys) - Priority conversion (high, medium, low, edge values) - UI context building (truncation, None handling, field extraction) - PendingDeferral creation (defaults, user_id extraction, timeout calc) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: Add template validation to setup QA tests Add custom validation for /v1/setup/templates endpoint to ensure: - default template (Datum) is present - ally template is present - At least 5 templates are returned - Template names match expected values 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: QA runner template validation now parses Response object The custom_validation callback receives requests.Response, not parsed JSON. Fixed _validate_templates_response to call .json() on the response. Also added INFO level debug logging to setup routes _get_agent_templates() to help diagnose template loading issues in production. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Add type parameters to _parse_deferral_context return type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Update CHANGELOG for v1.6.6 release Added release notes for: - PostgreSQL dialect odict_keys fix (#521, #522) - Deferral UI fields empty fix (#517) - DEBUG log level fixes (39 statements across 10 files) - Template consolidation (#519) - Wise Authority service refactoring - QA runner setup tests with template validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: API adapter now respects --port CLI argument over .env values - Remove load_env_vars() calls after config is set from dict/object - CLI args should take precedence over .env file values - Also fix setup_tests.py to keep default admin password The adapter was calling load_env_vars() after applying the config dict, which caused .env values to override CLI args. Now the precedence is: 1. Defaults (lowest) 2. .env file 3. Environment variables 4. CLI arguments (highest) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6d39f8e commit b13a760

37 files changed

Lines changed: 1140 additions & 4278 deletions

File tree

BUILD_INFO.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Build Information
2-
Code Hash: 39d5fa3029ce
3-
Build Time: 2025-11-23T20:28:47.366020
4-
Git Commit: 98aed22eba81664cadd2d0b27cec747f9e119b90
5-
Git Branch: release/1.6.5.1
2+
Code Hash: 758fb0330869
3+
Build Time: 2025-11-25T16:17:39.938214
4+
Git Commit: abb301b8fc71d8e670dae321f30d9b48aebead51
5+
Git Branch: release/1.6.6
66

77
This hash is a SHA-256 of all Python source files in the repository.
88
It provides a deterministic version identifier based on the actual code content.

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,58 @@ All notable changes to CIRIS Agent will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.6] - 2025-11-25
9+
10+
### Fixed - PostgreSQL Support & Log Noise Reduction
11+
12+
- **PostgreSQL Dialect Error** (#521, #522) - Fixed critical `odict_keys` subscript error causing massive log spam
13+
- **Issue**: `extract_scalar` in dialect.py failed with `TypeError: 'odict_keys' object is not subscriptable`
14+
- **Impact**: Scout agents on PostgreSQL generated 59-61 MB incident logs due to repeated errors
15+
- **Root Cause**: `row.keys()` returns `odict_keys` view object which doesn't support `[0]` indexing
16+
- **Fix**: Convert keys to list before indexing: `list(keys)[0]`
17+
- **Files**: `ciris_engine/logic/persistence/db/dialect.py:313`
18+
19+
- **Deferral UI Fields Empty** (#517) - Fixed pending deferrals showing empty context in UI
20+
- **Issue**: `/v1/wa/deferrals` returned deferrals with empty `question` and `context` fields
21+
- **Root Cause**: Service method wasn't populating UI-compatible fields from deferral data
22+
- **Fix**: Build rich context from task description, deferral context, and original message
23+
- **Files**: `ciris_engine/logic/services/governance/wise_authority/service.py:387-421`
24+
25+
- **DEBUG Info at INFO Level** - Reduced log noise by moving debug messages to DEBUG level
26+
- Changed 39 log statements across 10 files from INFO to DEBUG level
27+
- **Files affected**:
28+
- `graph.py` - add_graph_node debug messages
29+
- `memory_service.py` - LocalGraphMemoryService init
30+
- `audit_service/service.py` - audit entry creation
31+
- `action_dispatcher.py` - tool audit parameters
32+
- `wakeup_processor.py` - wakeup step processing
33+
- `setup.py` - auth database path
34+
- `audit.py` routes - audit entry conversion
35+
- `mock_llm/responses*.py` - message processing
36+
- `main.py` - exit point tracking
37+
38+
### Changed
39+
40+
- **Template Consolidation** (#519) - Moved all templates to single location
41+
- Templates now in `ciris_engine/ciris_templates/` (removed root `ciris_templates/`)
42+
- Added `ally` template to manifest generators
43+
- All 7 templates signed: default (Datum), ally, sage, scout, echo, echo-core, echo-speculative
44+
45+
### Improved
46+
47+
- **Wise Authority Service Refactoring** - Reduced cognitive complexity from 24 to ~10
48+
- Extracted 4 helper methods for better maintainability:
49+
- `_parse_deferral_context()` - Parse context JSON
50+
- `_priority_to_string()` - Convert int priority to string
51+
- `_build_ui_context()` - Build UI context dictionary
52+
- `_create_pending_deferral()` - Create PendingDeferral from data
53+
- Added 19 unit tests covering all helper methods
54+
55+
- **QA Runner Setup Tests** - Added template validation to setup module
56+
- Validates `default` (Datum) and `ally` templates are present
57+
- Verifies minimum template count and correct naming
58+
- Added debug logging to template loading for troubleshooting
59+
860
## [1.6.5.3] - 2025-11-23
961

1062
### Fixed - Setup User Creation Cache Bug

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
**A type-safe, auditable AI agent framework with built-in ethical reasoning**
1414

15-
**BETA RELEASE 1.6.5.3-stable** | [Release Notes](CHANGELOG.md) | [Documentation Hub](docs/README.md)
15+
**BETA RELEASE 1.6.6-stable** | [Release Notes](CHANGELOG.md) | [Documentation Hub](docs/README.md)
1616

1717
Academic paper https://zenodo.org/records/17195221
1818
Philosophical foundation https://ciris.ai/ciris_covenant.pdf

0 commit comments

Comments
 (0)