bug(tui): create_default_persona_for_actor does not auto-generate thinking-effort presets from actor schema #9360

Open
opened 2026-04-14 15:26:45 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(tui): auto-generate thinking-effort presets from actor schema in create_default_persona_for_actor
  • Branch: fix/tui-auto-generate-presets-actor-schema

Background and Context

ADR-045 (TUI Persona System) §Auto-Generated Presets specifies that when a persona is created on first run, the system must inspect the actor's argument schema to auto-generate useful presets:

When a persona is created (either automatically on first run or manually via the persona editor), the system inspects the actor's argument schema to auto-generate useful presets:

  1. Thinking effort detection — If the actor schema includes a thinking_effort argument (as all built-in LLM actors do), three presets are auto-generated:
    • "default"{} (uses base thinking_effort)
    • "think: high"{ thinking_effort: "high" }
    • "think: max"{ thinking_effort: "max" }
  2. Temperature detection — If the actor schema includes a temperature argument, presets for "precise" ({ temperature: 0.1 }) and "creative" ({ temperature: 0.9 }) are appended.
  3. No matching arguments — If the actor has no recognized argument patterns, only the "default" preset is created.

Current Behavior

src/cleveragents/tui/first_run.pycreate_default_persona_for_actor creates a persona with only the auto-created "default" preset (from the ensure_default_preset model validator), without inspecting the actor's argument schema:

def create_default_persona_for_actor(registry: PersonaRegistry, actor: str) -> Persona:
    persona = Persona(
        name="default",
        actor=actor,
        description="Default persona",
    )
    registry.save(persona)
    registry.set_last_persona(persona.name)
    return persona

First-run users always get only a single "default" preset regardless of the actor's capabilities, losing the auto-generated thinking-effort and temperature presets that the spec promises.

Expected Behavior

create_default_persona_for_actor should:

  1. Inspect the actor's argument schema (via the Actor Registry) to detect thinking_effort and temperature arguments
  2. Auto-generate the appropriate presets:
    • Always include "default" preset with empty overrides
    • If actor has thinking_effort: add "think: high" ({thinking_effort: "high"}) and "think: max" ({thinking_effort: "max"})
    • If actor has temperature: add "precise" ({temperature: 0.1}) and "creative" ({temperature: 0.9})
  3. Create the persona with these auto-generated presets

Acceptance Criteria

  • create_default_persona_for_actor inspects the actor's argument schema
  • For actors with thinking_effort argument: persona includes "default", "think: high", and "think: max" presets
  • For actors with temperature argument: persona additionally includes "precise" and "creative" presets
  • For actors with no recognized arguments: persona includes only "default" preset
  • BDD scenarios in tui_first_run.feature verify auto-generated presets for known actor types
  • All existing tests continue to pass

Supporting Information

  • Specification: docs/adr/ADR-045-tui-persona-system.md §Auto-Generated Presets (line ~139)
  • Affected file: src/cleveragents/tui/first_run.pycreate_default_persona_for_actor function
  • Actor schema inspection should use the Actor Registry/compiler to look up the actor's argument schema

Subtasks

  • Add actor schema inspection logic to create_default_persona_for_actor in src/cleveragents/tui/first_run.py
  • Implement _auto_generate_presets(actor: str) -> list[PersonaPreset] helper that detects thinking_effort and temperature arguments
  • Update create_default_persona_for_actor to pass auto-generated presets to Persona()
  • Add BDD scenarios in tui_first_run.feature for actors with thinking_effort, temperature, and no recognized arguments
  • Run nox -s unit_tests-3.13 and verify all tests pass
  • Verify coverage ≥97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • create_default_persona_for_actor auto-generates thinking-effort and temperature presets from the actor's argument schema per ADR-045
  • BDD scenarios cover all three cases (thinking_effort, temperature, no recognized args)
  • 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
  • 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 - **Commit Message**: `fix(tui): auto-generate thinking-effort presets from actor schema in create_default_persona_for_actor` - **Branch**: `fix/tui-auto-generate-presets-actor-schema` --- ## Background and Context ADR-045 (TUI Persona System) §Auto-Generated Presets specifies that when a persona is created on first run, the system must inspect the actor's argument schema to auto-generate useful presets: > When a persona is created (either automatically on first run or manually via the persona editor), the system inspects the actor's argument schema to auto-generate useful presets: > 1. **Thinking effort detection** — If the actor schema includes a `thinking_effort` argument (as all built-in LLM actors do), three presets are auto-generated: > - `"default"` → `{}` (uses base `thinking_effort`) > - `"think: high"` → `{ thinking_effort: "high" }` > - `"think: max"` → `{ thinking_effort: "max" }` > 2. **Temperature detection** — If the actor schema includes a `temperature` argument, presets for `"precise"` (`{ temperature: 0.1 }`) and `"creative"` (`{ temperature: 0.9 }`) are appended. > 3. **No matching arguments** — If the actor has no recognized argument patterns, only the `"default"` preset is created. ## Current Behavior `src/cleveragents/tui/first_run.py` — `create_default_persona_for_actor` creates a persona with only the auto-created `"default"` preset (from the `ensure_default_preset` model validator), without inspecting the actor's argument schema: ```python def create_default_persona_for_actor(registry: PersonaRegistry, actor: str) -> Persona: persona = Persona( name="default", actor=actor, description="Default persona", ) registry.save(persona) registry.set_last_persona(persona.name) return persona ``` First-run users always get only a single `"default"` preset regardless of the actor's capabilities, losing the auto-generated thinking-effort and temperature presets that the spec promises. ## Expected Behavior `create_default_persona_for_actor` should: 1. Inspect the actor's argument schema (via the Actor Registry) to detect `thinking_effort` and `temperature` arguments 2. Auto-generate the appropriate presets: - Always include `"default"` preset with empty overrides - If actor has `thinking_effort`: add `"think: high"` (`{thinking_effort: "high"}`) and `"think: max"` (`{thinking_effort: "max"}`) - If actor has `temperature`: add `"precise"` (`{temperature: 0.1}`) and `"creative"` (`{temperature: 0.9}`) 3. Create the persona with these auto-generated presets ## Acceptance Criteria - [ ] `create_default_persona_for_actor` inspects the actor's argument schema - [ ] For actors with `thinking_effort` argument: persona includes `"default"`, `"think: high"`, and `"think: max"` presets - [ ] For actors with `temperature` argument: persona additionally includes `"precise"` and `"creative"` presets - [ ] For actors with no recognized arguments: persona includes only `"default"` preset - [ ] BDD scenarios in `tui_first_run.feature` verify auto-generated presets for known actor types - [ ] All existing tests continue to pass ## Supporting Information - Specification: `docs/adr/ADR-045-tui-persona-system.md` §Auto-Generated Presets (line ~139) - Affected file: `src/cleveragents/tui/first_run.py` — `create_default_persona_for_actor` function - Actor schema inspection should use the Actor Registry/compiler to look up the actor's argument schema ## Subtasks - [ ] Add actor schema inspection logic to `create_default_persona_for_actor` in `src/cleveragents/tui/first_run.py` - [ ] Implement `_auto_generate_presets(actor: str) -> list[PersonaPreset]` helper that detects `thinking_effort` and `temperature` arguments - [ ] Update `create_default_persona_for_actor` to pass auto-generated presets to `Persona()` - [ ] Add BDD scenarios in `tui_first_run.feature` for actors with `thinking_effort`, `temperature`, and no recognized arguments - [ ] Run `nox -s unit_tests-3.13` and verify all tests pass - [ ] Verify coverage ≥97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - `create_default_persona_for_actor` auto-generates thinking-effort and temperature presets from the actor's argument schema per ADR-045 - BDD scenarios cover all three cases (thinking_effort, temperature, no recognized args) - 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 - 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-14 15:30:05 +00:00
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid bug: create_default_persona_for_actor in src/cleveragents/tui/first_run.py does not inspect the actor's argument schema to auto-generate thinking-effort and temperature presets as required by ADR-045 (TUI Persona System) §Auto-Generated Presets. First-run users always get only a single "default" preset regardless of the actor's capabilities.

Assigning to v3.7.0 (TUI Implementation) as this is a TUI persona system feature. Priority Medium — users miss out on useful presets but the system still functions.

MoSCoW: Should Have — auto-generated presets significantly improve the first-run experience for users with LLM actors that support thinking effort and temperature controls.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage: Verified** [AUTO-OWNR-1] Valid bug: `create_default_persona_for_actor` in `src/cleveragents/tui/first_run.py` does not inspect the actor's argument schema to auto-generate thinking-effort and temperature presets as required by ADR-045 (TUI Persona System) §Auto-Generated Presets. First-run users always get only a single "default" preset regardless of the actor's capabilities. Assigning to **v3.7.0** (TUI Implementation) as this is a TUI persona system feature. Priority **Medium** — users miss out on useful presets but the system still functions. MoSCoW: **Should Have** — auto-generated presets significantly improve the first-run experience for users with LLM actors that support thinking effort and temperature controls. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-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.

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