UAT: Auto-generated argument presets on persona creation not implemented #1360

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

Bug Report: [tui/persona] — No auto-generation of argument presets from actor schema

Severity Assessment

  • Impact: Medium. New personas are created with only a single "default" preset (enforced by the model validator). The spec requires auto-generating useful presets (thinking effort levels, temperature variants) by inspecting the actor's argument schema. Without this, users must manually create all presets.
  • Likelihood: 100% reproducible — no auto-generation logic exists anywhere in the codebase.
  • Priority: Medium

Location

  • Missing: No auto-preset generation function in src/cleveragents/tui/persona/
  • Related: src/cleveragents/tui/persona/registry.pyensure_default() (lines 205–212)

Description

The specification (§First-Run Experience and ADR-045 §Auto-Generated Presets) defines automatic preset generation when a persona is created:

Selection creates a "default" persona with the chosen actor and auto-generated argument presets (thinking effort levels are auto-detected from the actor's argument schema).

From ADR-045 §Auto-Generated 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.

Actual Behavior

The ensure_default() method creates a persona with only the mandatory "default" preset (auto-added by the Persona model validator):

def ensure_default(self, actor: str = "local/mock-default") -> Persona:
    existing = self.get("default")
    if existing is not None:
        return existing
    persona = Persona(name="default", actor=actor, description="Default persona")
    saved = Persona.model_validate(persona.model_dump())
    self.save(saved)
    self.set_last_persona(saved.name)
    return saved

No actor schema inspection occurs. No presets beyond "default" are generated.

Verified:

reg = PersonaRegistry(config_dir=tmp)
default = reg.ensure_default(actor='anthropic/claude-4-sonnet')
print([p.name for p in default.argument_presets])
# Output: ['default']
# Expected: ['default', 'think: high', 'think: max'] (for actors with thinking_effort)

There is no generate_presets_for_actor() function or similar anywhere in src/cleveragents/tui/.

Expected Behavior (from spec)

A function (e.g., generate_presets_for_actor(actor_name: str) -> list[PersonaPreset]) should:

  1. Look up the actor's argument schema from the Actor Registry
  2. Check for thinking_effort argument → generate think: high and think: max presets
  3. Check for temperature argument → generate precise and creative presets
  4. Return the generated presets (always including "default" as first)

This function should be called by ensure_default() and by PersonaEditorModal when creating a new persona.

Steps to Reproduce

import tempfile, shutil
from pathlib import Path
from cleveragents.tui.persona.registry import PersonaRegistry

tmp = Path(tempfile.mkdtemp())
try:
    reg = PersonaRegistry(config_dir=tmp)
    # Simulate creating a persona for an actor with thinking_effort
    default = reg.ensure_default(actor='anthropic/claude-4-sonnet')
    preset_names = [p.name for p in default.argument_presets]
    print(preset_names)
    # Output: ['default']
    # Expected: ['default', 'think: high', 'think: max']
finally:
    shutil.rmtree(str(tmp))
  • #1350 (UAT: First-run experience not implemented)
  • #1353 (UAT: PersonaEditorModal widget not implemented)
  • #1315 (Refactor TUI to Align with ADR-44 and ADR-45)

References

  • Spec §First-Run Experience (line ~29124)
  • ADR-045 §Auto-Generated Presets
  • ADR-045 §Compliance (auto-generation tests)
  • src/cleveragents/tui/persona/registry.py lines 205–212
## Bug Report: [tui/persona] — No auto-generation of argument presets from actor schema ### Severity Assessment - **Impact**: Medium. New personas are created with only a single `"default"` preset (enforced by the model validator). The spec requires auto-generating useful presets (thinking effort levels, temperature variants) by inspecting the actor's argument schema. Without this, users must manually create all presets. - **Likelihood**: 100% reproducible — no auto-generation logic exists anywhere in the codebase. - **Priority**: Medium ### Location - **Missing**: No auto-preset generation function in `src/cleveragents/tui/persona/` - **Related**: `src/cleveragents/tui/persona/registry.py` — `ensure_default()` (lines 205–212) ### Description The specification (§First-Run Experience and ADR-045 §Auto-Generated Presets) defines automatic preset generation when a persona is created: > Selection creates a `"default"` persona with the chosen actor and **auto-generated argument presets** (thinking effort levels are auto-detected from the actor's argument schema). From ADR-045 §Auto-Generated 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. ### Actual Behavior The `ensure_default()` method creates a persona with only the mandatory `"default"` preset (auto-added by the `Persona` model validator): ```python def ensure_default(self, actor: str = "local/mock-default") -> Persona: existing = self.get("default") if existing is not None: return existing persona = Persona(name="default", actor=actor, description="Default persona") saved = Persona.model_validate(persona.model_dump()) self.save(saved) self.set_last_persona(saved.name) return saved ``` No actor schema inspection occurs. No presets beyond `"default"` are generated. Verified: ```python reg = PersonaRegistry(config_dir=tmp) default = reg.ensure_default(actor='anthropic/claude-4-sonnet') print([p.name for p in default.argument_presets]) # Output: ['default'] # Expected: ['default', 'think: high', 'think: max'] (for actors with thinking_effort) ``` There is no `generate_presets_for_actor()` function or similar anywhere in `src/cleveragents/tui/`. ### Expected Behavior (from spec) A function (e.g., `generate_presets_for_actor(actor_name: str) -> list[PersonaPreset]`) should: 1. Look up the actor's argument schema from the Actor Registry 2. Check for `thinking_effort` argument → generate `think: high` and `think: max` presets 3. Check for `temperature` argument → generate `precise` and `creative` presets 4. Return the generated presets (always including `"default"` as first) This function should be called by `ensure_default()` and by `PersonaEditorModal` when creating a new persona. ### Steps to Reproduce ```python import tempfile, shutil from pathlib import Path from cleveragents.tui.persona.registry import PersonaRegistry tmp = Path(tempfile.mkdtemp()) try: reg = PersonaRegistry(config_dir=tmp) # Simulate creating a persona for an actor with thinking_effort default = reg.ensure_default(actor='anthropic/claude-4-sonnet') preset_names = [p.name for p in default.argument_presets] print(preset_names) # Output: ['default'] # Expected: ['default', 'think: high', 'think: max'] finally: shutil.rmtree(str(tmp)) ``` ### Related Issues - #1350 (UAT: First-run experience not implemented) - #1353 (UAT: PersonaEditorModal widget not implemented) - #1315 (Refactor TUI to Align with ADR-44 and ADR-45) ### References - Spec §First-Run Experience (line ~29124) - ADR-045 §Auto-Generated Presets - ADR-045 §Compliance (auto-generation tests) - `src/cleveragents/tui/persona/registry.py` lines 205–212
freemo self-assigned this 2026-04-02 18:45:18 +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.

Dependencies

No dependencies set.

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