UAT: Session export JSON missing required fields name and conversation_history #10331

Open
opened 2026-04-18 08:48:18 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Issue Type: Type/Bug
  • Priority: Priority/Critical
  • MoSCoW: MoSCoW/Must Have
  • Branch: bugfix/m130-session-export-json-fields
  • Commit Message: fix(session): add name and conversation_history fields to export JSON

Description

During UAT testing of the TUI Session Persistence feature, the session export JSON output is missing two required fields specified in the spec.

Expected behaviour (from spec):
Session export JSON must include these fields: session_id, name, created_at, updated_at, conversation_history.

Actual behaviour:
Inspecting src/cleveragents/domain/models/core/session.py, the as_export_dict() method returns:

{
  "schema_version": "...",
  "session_id": "...",
  "actor_name": "...",
  "namespace": "...",
  "messages": [...],
  "linked_plan_ids": [...],
  "token_usage": {...},
  "metadata": {...},
  "created_at": "...",
  "updated_at": "...",
  "checksum": "..."
}

Two spec-required fields are absent:

  1. name — the session name is not included in the export dict (the field exists on the Session model but is not exported).
  2. conversation_history — the spec requires this field name, but the export uses messages instead.

Reproduction steps:

  1. Inspect src/cleveragents/domain/models/core/session.py, method as_export_dict().
  2. Observe that name is not present in the returned dict.
  3. Observe that the conversation history is exported under the key messages, not conversation_history.

Acceptance Criteria

  • as_export_dict() includes a name field containing the session name.
  • as_export_dict() uses conversation_history as the key for the message list (not messages).
  • Import logic (import_session()) is updated to read from conversation_history (with backward-compatible fallback to messages for older exports).
  • All existing export/import tests are updated to reflect the new field names.

Subtasks

  • Add "name": self.name to the export dict in as_export_dict().
  • Rename the messages key to conversation_history in as_export_dict().
  • Update import_session() in session_service.py to read from conversation_history (with fallback to messages).
  • Update TUI _session_import() in commands.py to use conversation_history.
  • Update all Behave scenarios in features/tui_session_export_import.feature for new field names.
  • Update Robot Framework tests for new field names.
  • Verify coverage ≥97% via nox -s coverage_report.
  • Run nox (all default sessions), fix any errors.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Issue Type:** Type/Bug - **Priority:** Priority/Critical - **MoSCoW:** MoSCoW/Must Have - **Branch:** bugfix/m130-session-export-json-fields - **Commit Message:** fix(session): add name and conversation_history fields to export JSON ## Description During UAT testing of the TUI Session Persistence feature, the session export JSON output is missing two required fields specified in the spec. **Expected behaviour (from spec):** Session export JSON must include these fields: `session_id`, `name`, `created_at`, `updated_at`, `conversation_history`. **Actual behaviour:** Inspecting `src/cleveragents/domain/models/core/session.py`, the `as_export_dict()` method returns: ```json { "schema_version": "...", "session_id": "...", "actor_name": "...", "namespace": "...", "messages": [...], "linked_plan_ids": [...], "token_usage": {...}, "metadata": {...}, "created_at": "...", "updated_at": "...", "checksum": "..." } ``` Two spec-required fields are **absent**: 1. `name` — the session name is not included in the export dict (the field exists on the `Session` model but is not exported). 2. `conversation_history` — the spec requires this field name, but the export uses `messages` instead. **Reproduction steps:** 1. Inspect `src/cleveragents/domain/models/core/session.py`, method `as_export_dict()`. 2. Observe that `name` is not present in the returned dict. 3. Observe that the conversation history is exported under the key `messages`, not `conversation_history`. ## Acceptance Criteria - [ ] `as_export_dict()` includes a `name` field containing the session name. - [ ] `as_export_dict()` uses `conversation_history` as the key for the message list (not `messages`). - [ ] Import logic (`import_session()`) is updated to read from `conversation_history` (with backward-compatible fallback to `messages` for older exports). - [ ] All existing export/import tests are updated to reflect the new field names. ## Subtasks - [ ] Add `"name": self.name` to the export dict in `as_export_dict()`. - [ ] Rename the `messages` key to `conversation_history` in `as_export_dict()`. - [ ] Update `import_session()` in `session_service.py` to read from `conversation_history` (with fallback to `messages`). - [ ] Update TUI `_session_import()` in `commands.py` to use `conversation_history`. - [ ] Update all Behave scenarios in `features/tui_session_export_import.feature` for new field names. - [ ] Update Robot Framework tests for new field names. - [ ] Verify coverage ≥97% via `nox -s coverage_report`. - [ ] Run `nox` (all default sessions), fix any errors. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-18 09:00:30 +00:00
Author
Owner

[GROOMED] Quality Analysis & Triage

Issue Assessment: VALID & ACTIONABLE

This is a legitimate Priority/Critical UAT bug with clear reproduction steps, well-defined acceptance criteria, and specific subtasks. The issue is properly scoped and ready for implementation.

Current Status

  • State: State/Unverified → Should be State/Verified ⚠️
  • Type: Type/Bug
  • Priority: Priority/Critical
  • MoSCoW: MoSCoW/Must have
  • Milestone: v3.7.0 (M8: TUI Implementation) [ASSIGNED]
  • Assignee: None (needs assignment)

Triage Findings

Strengths

  1. Clear Problem Statement: Missing name and conversation_history fields in session export JSON
  2. Spec Reference: Explicitly references expected vs actual behavior with code examples
  3. Acceptance Criteria: Well-defined with 3 clear requirements
  4. Subtasks: Comprehensive breakdown including export dict modifications, import logic updates with backward compatibility, test updates, and coverage verification (≥97%)
  5. Definition of Done: Clear completion criteria including PR merge requirement
  6. Branch & Commit: Metadata includes branch name and commit message format

⚠️ Issues Found

  1. Label Transition Blocked: State/Unverified → State/Verified requires manual intervention (API restrictions prevent automated label changes)
  2. No Assignee: Issue is unassigned and needs a developer assignment
  3. No Epic Link: While contextually part of TUI Session Persistence, no explicit epic link exists
  1. Manual Label Update: Change State/Unverified (846) → State/Verified (847)
  2. Assign Developer: Assign to appropriate team member for implementation
  3. Link to Epic (if applicable): Consider linking to TUI Session Persistence epic

Priority/Critical Flag 🚨

This is a Priority/Critical issue with no State/In Progress. It requires immediate attention and should be prioritized for the next sprint.

Grooming Verdict

APPROVED FOR DEVELOPMENT — All required labels present, milestone assigned, issue is valid and actionable. Ready for developer assignment and implementation.


Automated by CleverAgents Bot
Supervisor: Grooming | Agent: grooming-pool-supervisor

## [GROOMED] Quality Analysis & Triage ### Issue Assessment: ✅ VALID & ACTIONABLE This is a **legitimate Priority/Critical UAT bug** with clear reproduction steps, well-defined acceptance criteria, and specific subtasks. The issue is properly scoped and ready for implementation. ### Current Status - **State**: State/Unverified → **Should be State/Verified** ⚠️ - **Type**: Type/Bug ✅ - **Priority**: Priority/Critical ✅ - **MoSCoW**: MoSCoW/Must have ✅ - **Milestone**: v3.7.0 (M8: TUI Implementation) ✅ **[ASSIGNED]** - **Assignee**: None (needs assignment) ### Triage Findings #### ✅ Strengths 1. **Clear Problem Statement**: Missing `name` and `conversation_history` fields in session export JSON 2. **Spec Reference**: Explicitly references expected vs actual behavior with code examples 3. **Acceptance Criteria**: Well-defined with 3 clear requirements 4. **Subtasks**: Comprehensive breakdown including export dict modifications, import logic updates with backward compatibility, test updates, and coverage verification (≥97%) 5. **Definition of Done**: Clear completion criteria including PR merge requirement 6. **Branch & Commit**: Metadata includes branch name and commit message format #### ⚠️ Issues Found 1. **Label Transition Blocked**: State/Unverified → State/Verified requires manual intervention (API restrictions prevent automated label changes) 2. **No Assignee**: Issue is unassigned and needs a developer assignment 3. **No Epic Link**: While contextually part of TUI Session Persistence, no explicit epic link exists ### Recommended Actions 1. **Manual Label Update**: Change State/Unverified (846) → State/Verified (847) 2. **Assign Developer**: Assign to appropriate team member for implementation 3. **Link to Epic** (if applicable): Consider linking to TUI Session Persistence epic ### Priority/Critical Flag 🚨 This is a **Priority/Critical** issue with **no State/In Progress**. It requires immediate attention and should be prioritized for the next sprint. ### Grooming Verdict ✅ **APPROVED FOR DEVELOPMENT** — All required labels present, milestone assigned, issue is valid and actionable. Ready for developer assignment and implementation. --- **Automated by CleverAgents Bot** Supervisor: Grooming | Agent: grooming-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10331
No description provided.