UAT: PersonaState.effective_arguments() is dead code — persona base_arguments and presets never applied to agent invocations #3983

Open
opened 2026-04-06 08:16:26 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/backlog-persona-effective-arguments-not-applied
  • Commit Message: fix(tui): apply persona effective_arguments to agent invocations
  • Milestone: None (Backlog)
  • Parent Epic: #868

Summary

PersonaState.effective_arguments() is defined in src/cleveragents/tui/persona/state.py but is never called anywhere in the application. As a result, the base_arguments and argument_presets configured in a persona are computed but never passed to agent invocations. Switching presets with ctrl+tab updates the PersonaBar display but has no effect on actual agent behavior.

Backlog note: This issue was discovered during autonomous UAT testing of the Persona and Identity Management feature area. It does not block any current milestone and has been placed in the backlog for human review.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Current Behavior

  1. PersonaState.effective_arguments(session_id) is defined in src/cleveragents/tui/persona/state.py (lines 66-69)
  2. The method correctly computes merged arguments from base_arguments + active preset overrides
  3. However, this method is never called anywhere in the codebase — confirmed by searching all .py files in src/cleveragents/
  4. When a user submits a prompt in the TUI (on_input_submitted in src/cleveragents/tui/app.py), the InputModeRouter processes the text but does NOT retrieve or apply the persona's effective arguments
  5. The ctrl+tab preset cycling (action_cycle_preset) updates the PersonaBar display but the changed preset has no effect on subsequent agent calls

Expected Behavior (from ADR-045 §Argument Preset Resolution)

Per docs/adr/ADR-045-tui-persona-system.md §Argument Preset Resolution:

When the user selects a preset (via ctrl+tab), the effective arguments are computed as:
effective_arguments = merge(base_arguments, active_preset.overrides)
The active preset's display name appears in the PersonaBar. The effective arguments change immediately for the next prompt.

Per docs/specification.md §Persona Cycling:

When cycling, the PersonaBar updates immediately. The actor binding for the session is updated — subsequent prompts use the new persona's actor and scope.

Steps to Reproduce

  1. Create a persona with base_arguments: {thinking_effort: "medium"} and a preset think-max with overrides: {thinking_effort: "max"}
  2. Launch the TUI and set the persona as active
  3. Press ctrl+tab to switch to the think-max preset
  4. Submit a prompt
  5. Observe: The agent is invoked without thinking_effort: "max" — the preset override is silently ignored

Code Location

  • Dead method: src/cleveragents/tui/persona/state.py, PersonaState.effective_arguments() (lines 66-69)
  • Where it should be called: src/cleveragents/tui/app.py, on_input_submitted() handler — when building the agent invocation payload
  • Also defined but unused: src/cleveragents/tui/persona/schema.py, Persona.effective_arguments() (lines 71-80)

Subtasks

  • Identify the agent invocation code path in the TUI (likely through TuiCommandRouter or a future A2A call)
  • Call persona_state.effective_arguments(session_id) when building the agent invocation payload
  • Pass the effective arguments to the actor/agent call
  • Add Behave BDD tests verifying that preset changes affect agent invocation arguments
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • PersonaState.effective_arguments() is called when submitting prompts in the TUI
  • The effective arguments are passed to the agent/actor invocation
  • Switching presets with ctrl+tab changes the arguments used in subsequent prompts
  • BDD tests verify the argument application behavior
  • 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.
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/backlog-persona-effective-arguments-not-applied` - **Commit Message**: `fix(tui): apply persona effective_arguments to agent invocations` - **Milestone**: None (Backlog) - **Parent Epic**: #868 ## Summary `PersonaState.effective_arguments()` is defined in `src/cleveragents/tui/persona/state.py` but is **never called anywhere** in the application. As a result, the `base_arguments` and `argument_presets` configured in a persona are computed but never passed to agent invocations. Switching presets with `ctrl+tab` updates the PersonaBar display but has no effect on actual agent behavior. > **Backlog note:** This issue was discovered during autonomous UAT testing of the Persona and Identity Management feature area. It does not block any current milestone and has been placed in the backlog for human review. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Current Behavior 1. `PersonaState.effective_arguments(session_id)` is defined in `src/cleveragents/tui/persona/state.py` (lines 66-69) 2. The method correctly computes merged arguments from `base_arguments` + active preset overrides 3. **However**, this method is never called anywhere in the codebase — confirmed by searching all `.py` files in `src/cleveragents/` 4. When a user submits a prompt in the TUI (`on_input_submitted` in `src/cleveragents/tui/app.py`), the `InputModeRouter` processes the text but does NOT retrieve or apply the persona's effective arguments 5. The `ctrl+tab` preset cycling (`action_cycle_preset`) updates the PersonaBar display but the changed preset has no effect on subsequent agent calls ## Expected Behavior (from ADR-045 §Argument Preset Resolution) Per `docs/adr/ADR-045-tui-persona-system.md` §Argument Preset Resolution: > When the user selects a preset (via `ctrl+tab`), the effective arguments are computed as: > `effective_arguments = merge(base_arguments, active_preset.overrides)` > The active preset's `display` name appears in the PersonaBar. **The effective arguments change immediately for the next prompt.** Per `docs/specification.md` §Persona Cycling: > When cycling, the PersonaBar updates immediately. **The actor binding for the session is updated — subsequent prompts use the new persona's actor and scope.** ## Steps to Reproduce 1. Create a persona with `base_arguments: {thinking_effort: "medium"}` and a preset `think-max` with `overrides: {thinking_effort: "max"}` 2. Launch the TUI and set the persona as active 3. Press `ctrl+tab` to switch to the `think-max` preset 4. Submit a prompt 5. Observe: The agent is invoked without `thinking_effort: "max"` — the preset override is silently ignored ## Code Location - **Dead method**: `src/cleveragents/tui/persona/state.py`, `PersonaState.effective_arguments()` (lines 66-69) - **Where it should be called**: `src/cleveragents/tui/app.py`, `on_input_submitted()` handler — when building the agent invocation payload - **Also defined but unused**: `src/cleveragents/tui/persona/schema.py`, `Persona.effective_arguments()` (lines 71-80) ## Subtasks - [ ] Identify the agent invocation code path in the TUI (likely through `TuiCommandRouter` or a future A2A call) - [ ] Call `persona_state.effective_arguments(session_id)` when building the agent invocation payload - [ ] Pass the effective arguments to the actor/agent call - [ ] Add Behave BDD tests verifying that preset changes affect agent invocation arguments - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - [ ] `PersonaState.effective_arguments()` is called when submitting prompts in the TUI - [ ] The effective arguments are passed to the agent/actor invocation - [ ] Switching presets with `ctrl+tab` changes the arguments used in subsequent prompts - [ ] BDD tests verify the argument application behavior - 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. - All nox stages pass - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:23 +00:00
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.

Blocks
Reference
cleveragents/cleveragents-core#3983
No description provided.