feat(tui): implement prompt history (dual JSONL) #1014

Open
opened 2026-03-17 01:11:22 +00:00 by brent.edwards · 3 comments
Member

Dual JSONL history files: prompt history and shell history.

Dependencies

  • Parent: #868 (Epic: TUI Interface)
  • Tracked by: #926
Dual JSONL history files: prompt history and shell history. ## Dependencies - Parent: #868 (Epic: TUI Interface) - Tracked by: #926
brent.edwards added this to the v3.8.0 milestone 2026-03-17 01:12:07 +00:00
Author
Member

Implementation progress for #1014 is on branch feature/m8-tui-prompt-history and PR #1252.

What is implemented:

  • Added src/cleveragents/tui/prompt_history.py with a per-project dual JSONL history manager.
  • Prompt and shell histories are stored separately:
    • prompt.jsonl
    • shell.jsonl
  • Project scoping is derived from a hashed project key (CLEVERAGENTS_PROJECT when set, otherwise current working directory).
  • Added capped history persistence (10,000 entries, oldest pruned on write).
  • Added independent prompt vs shell navigation cursors and draft restoration behavior.
  • Updated src/cleveragents/tui/widgets/prompt.py to append history and navigate previous/next entries.
  • Updated src/cleveragents/tui/app.py to:
    • inject the prompt history manager into the prompt widget
    • record raw submitted text into prompt vs shell history
    • expose up / down history actions
  • Added Behave coverage for history manager persistence, pruning, prompt draft restoration, and shell-history separation.
  • Expanded app coverage for history file writes and app-level history navigation.
  • Added Robot smoke coverage for dual-history persistence and retrieval.

Validation status on the rebased branch (26d06fc1):

  • nox -s lint typecheck unit_tests -- features/tui_prompt_history_coverage.feature features/tui_app_coverage.feature
    • PASS
    • log: /tmp/issue-1014-targeted-nox.log
  • PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1014/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot
    • PASS
    • log: /tmp/issue-1014-robot.log
  • nox -s coverage_report
    • PASS after deleting stale build/.template-migrated.db before rerun
    • result: COVERAGE OK: 98.6% (threshold: 97%)
    • log: /tmp/issue-1014-coverage.log
  • nox -s integration_tests e2e_tests
    • integration_tests PASS
    • e2e_tests FAIL
    • log: /tmp/issue-1014-integration-e2e.log
  • nox -s e2e_tests rerun
    • FAIL again
    • log: /tmp/issue-1014-e2e-rerun.log

Current blocker:

  • The remaining failures are in external real-LLM E2E workflows, not in the TUI prompt-history path.
  • The rerun logs show upstream/external execution problems during real workflow plans, including authentication failures such as:
    • AuthenticationError: Error code: 401 ... Invalid authentication credentials
  • Observed failing E2E workflows in the rerun log:
    • WF12 Large Scale Hierarchical Feature Implementation
    • WF17 Explicit Container With Directory Mount Trusted Profile
    • WF18 Container With Remote Repo Clone Trusted Profile
  • Because full e2e_tests is not green, I am leaving this issue in State/In Progress rather than moving it to review.

Traceability:

  • Original commit before rebase: 81364353
  • Rebasing onto newer master produced current commit: 26d06fc1
  • PR: #1252
Implementation progress for #1014 is on branch `feature/m8-tui-prompt-history` and PR #1252. What is implemented: - Added `src/cleveragents/tui/prompt_history.py` with a per-project dual JSONL history manager. - Prompt and shell histories are stored separately: - `prompt.jsonl` - `shell.jsonl` - Project scoping is derived from a hashed project key (`CLEVERAGENTS_PROJECT` when set, otherwise current working directory). - Added capped history persistence (10,000 entries, oldest pruned on write). - Added independent prompt vs shell navigation cursors and draft restoration behavior. - Updated `src/cleveragents/tui/widgets/prompt.py` to append history and navigate previous/next entries. - Updated `src/cleveragents/tui/app.py` to: - inject the prompt history manager into the prompt widget - record raw submitted text into prompt vs shell history - expose `up` / `down` history actions - Added Behave coverage for history manager persistence, pruning, prompt draft restoration, and shell-history separation. - Expanded app coverage for history file writes and app-level history navigation. - Added Robot smoke coverage for dual-history persistence and retrieval. Validation status on the rebased branch (`26d06fc1`): - `nox -s lint typecheck unit_tests -- features/tui_prompt_history_coverage.feature features/tui_app_coverage.feature` - PASS - log: `/tmp/issue-1014-targeted-nox.log` - `PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1014/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot` - PASS - log: `/tmp/issue-1014-robot.log` - `nox -s coverage_report` - PASS after deleting stale `build/.template-migrated.db` before rerun - result: `COVERAGE OK: 98.6% (threshold: 97%)` - log: `/tmp/issue-1014-coverage.log` - `nox -s integration_tests e2e_tests` - `integration_tests` PASS - `e2e_tests` FAIL - log: `/tmp/issue-1014-integration-e2e.log` - `nox -s e2e_tests` rerun - FAIL again - log: `/tmp/issue-1014-e2e-rerun.log` Current blocker: - The remaining failures are in external real-LLM E2E workflows, not in the TUI prompt-history path. - The rerun logs show upstream/external execution problems during real workflow plans, including authentication failures such as: - `AuthenticationError: Error code: 401 ... Invalid authentication credentials` - Observed failing E2E workflows in the rerun log: - `WF12 Large Scale Hierarchical Feature Implementation` - `WF17 Explicit Container With Directory Mount Trusted Profile` - `WF18 Container With Remote Repo Clone Trusted Profile` - Because full `e2e_tests` is not green, I am leaving this issue in `State/In Progress` rather than moving it to review. Traceability: - Original commit before rebase: `81364353` - Rebasing onto newer `master` produced current commit: `26d06fc1` - PR: #1252
Owner

PR #1252 Review Outcome: Changes Requested

PR #1252 (feat(tui): implement prompt history (dual JSONL)) has been reviewed by reviewer-pool-1. Two blocking issues were identified:

  1. Merge conflicts — The branch feature/m8-tui-prompt-history has conflicts with master and must be rebased.
  2. Empty PR description — The PR body is missing; it needs a summary, motivation, and Closes #1014 closing keyword.

Code quality is good — the implementation is well-structured, properly typed, well-tested (4 Behave + 2 app-level + 1 Robot scenario), and follows project conventions. Once the two blockers are resolved, the PR is ready to merge.

**PR #1252 Review Outcome: Changes Requested** PR #1252 (`feat(tui): implement prompt history (dual JSONL)`) has been reviewed by reviewer-pool-1. Two blocking issues were identified: 1. **Merge conflicts** — The branch `feature/m8-tui-prompt-history` has conflicts with `master` and must be rebased. 2. **Empty PR description** — The PR body is missing; it needs a summary, motivation, and `Closes #1014` closing keyword. **Code quality is good** — the implementation is well-structured, properly typed, well-tested (4 Behave + 2 app-level + 1 Robot scenario), and follows project conventions. Once the two blockers are resolved, the PR is ready to merge.
freemo self-assigned this 2026-04-02 18:45:28 +00:00
Owner

Label compliance fix applied:

  • Replaced orphaned label State/In Progress with valid label State/In progress
  • Reason: State/In Progress (capital P) is an orphaned label that no longer exists in the repository's label list. The correct label is State/In progress (lowercase p, ID: 1322).

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Replaced orphaned label `State/In Progress` with valid label `State/In progress` - Reason: `State/In Progress` (capital P) is an orphaned label that no longer exists in the repository's label list. The correct label is `State/In progress` (lowercase p, ID: 1322). --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
freemo removed this from the v3.8.0 milestone 2026-04-07 02:41:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1014
No description provided.