Skip to content

fix(ai): chat loads each persona prompt and challenger gets tools #4824

Closed

Description

@dan-petty

Problem Description

The chat prompt of a persona loses part of its text, and the challenger persona gets the wrong tools:

  • chat_prompt in src/devops_cli/ai/personas/__init__.py is role.md + tasks/chat.md. It drops prompt.md. Thus the debate rules of challenger and the threat model of devsecops never reach chat.
  • The tool map in src/devops_cli/ai/tools/registry.py falls back to the default tools for challenger.
  • _expand_persona_rag_query in src/devops_cli/ai/rag/retriever.py matches substrings of the persona name ("sec", "arch"), and has no challenger branch.

Reproduction Steps

  1. Build the persona definition of challenger, and search its chat_prompt for a line of personas/challenger/prompt.md. The line is not there.
  2. Read the tool set that the registry gives challenger. It is the default set.

Expected vs Actual Behavior

  • Expected: each chat prompt holds the role, the chat task and the persona prompt. Each persona has its own tool set and RAG terms.
  • Actual: chat drops the persona prompt, and challenger gets the default tools and no RAG terms.

Proposed Solution

  • chat_prompt = role.md + tasks/chat.md + prompt.md.
  • Key the tool map and the RAG expansion on the Persona enum, not on substrings.
  • Give challenger a read-only tool set and RAG terms.

Existing Tool Considered

A fix of project code. No tool applies. Cost to build: about 40,000 tokens and 1 hour.

Acceptance Criteria

  • A test finds the text of each prompt.md in the chat prompt of its persona.
  • The tool map has 6 entries, and challenger has a read-only set that is not the default set.
  • The RAG test expands a challenger query.

Dependencies

None.

Source: #4780

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/bug
    scope/ai
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P2-Medium. Personas silently lose prompt text and get wrong tools, degrading chat quality but not breaking the tool entirely.
    • Value: Medium. Users of challenger and devsecops personas get incomplete prompts and wrong tools, reducing output quality.
    • Effort: Low. The body estimates about 40,000 tokens and 1 hour across three small file changes.
    • Related: fix(ai): streamed devops ai chat turns send the user's message #874, which asks for a different change. Both fix bugs in the devops ai chat path, but 874 fixes the streaming path dropping the user message while the candidate fixes persona prompt assembly and tool assignment.
  4. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 11, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 12, 2026
  6. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 12:40 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions