Skip to content

Introduce visible-reasoning agent to resolve conflicting chain-of-thought guidance#183

Merged
Bryan-Roe merged 5 commits into
mainfrom
copilot/fix-conflicting-agent-description-again
May 9, 2026
Merged

Introduce visible-reasoning agent to resolve conflicting chain-of-thought guidance#183
Bryan-Roe merged 5 commits into
mainfrom
copilot/fix-conflicting-agent-description-again

Conversation

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

agi-reasoning is used by both agi.prompt.md (chain-of-thought hidden, final answer only) and reason.prompt.md (explicit "show your reasoning at each step") — directly contradictory instructions on the same agent.

Changes

  • New agent.github/agents/visible-reasoning.agent.md: dedicated agent for exposed step-by-step reasoning. Core contract is "Show Your Work" — all five phases (Analyze → Decompose → Execute → Reflect → Synthesize) must appear in the response. Explicitly distinguishes itself from agi-reasoning:

    "agi-reasoning keeps chain-of-thought internal (only delivers the final answer). This agent surfaces reasoning explicitly so the user can follow, verify, and learn from each step."

  • reason.prompt.md: switches agent: agi-reasoningagent: visible-reasoning; description updated to reflect visible output contract.

  • copilot-instructions.md: agents table now lists both agents with distinct purpose descriptions; prompts list clarifies that reason.prompt.md uses visible-reasoning for exposed chain-of-thought vs. agi.prompt.md which uses agi-reasoning for internal-only reasoning.

Result

Prompt Agent Chain-of-thought
agi.prompt.md agi-reasoning Internal only
reason.prompt.md visible-reasoning Fully exposed

Summary by Sourcery

Introduce a dedicated visible-reasoning agent and wire it into the structured reasoning prompt so visible chain-of-thought is explicitly separated from internal-only AGI reasoning.

New Features:

  • Add a visible-reasoning agent specialized in exposing step-by-step chain-of-thought to users.

Enhancements:

  • Update the Reason prompt to use the new visible-reasoning agent and clarify its visible reasoning contract.
  • Clarify Copilot instructions to distinguish between internal-only agi-reasoning and the new visible-reasoning agent in both the agents list and prompts table.

… for reason.prompt.md

Agent-Logs-Url: https://github.com/Bryan-Roe/Aria/sessions/c4dc5aba-a88f-41ea-8264-102d07344b71

Co-authored-by: Bryan-Roe <74067792+Bryan-Roe@users.noreply.github.com>
@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

🔴 Coverage — d4c9471

Metric Value
Total coverage 59.7%
→ vs main 0.0%
Minimum threshold 60%

Updated on every push · 2026-05-09

Copilot AI requested review from Copilot and removed request for Copilot April 30, 2026 16:35
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Apr 30, 2026
Copilot AI changed the title [WIP] Fix conflicting agent description regarding chain-of-thought Introduce visible-reasoning agent to resolve conflicting chain-of-thought guidance Apr 30, 2026
Copilot AI requested a review from Bryan-Roe April 30, 2026 16:35
@Bryan-Roe Bryan-Roe marked this pull request as ready for review April 30, 2026 19:55
@Bryan-Roe Bryan-Roe requested review from Copilot and removed request for Bryan-Roe April 30, 2026 19:55
@sourcery-ai

sourcery-ai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Introduces a new visible-reasoning agent dedicated to fully exposed chain-of-thought reasoning, re-wires the reason.prompt.md prompt to use it instead of agi-reasoning, and updates the Copilot instructions to clearly distinguish between internal-only and visible reasoning behaviors across agents and prompts.

Sequence diagram for visible reasoning with the new visible-reasoning agent

sequenceDiagram
    actor Developer
    participant CopilotExtension
    participant ReasonPrompt as reason_prompt_md
    participant VisibleReasoningAgent as visible-reasoning_agent_md
    participant AGIProvider as AGIProvider_verbose
    participant LLM

    Developer->>CopilotExtension: Request structured visible reasoning
    CopilotExtension->>ReasonPrompt: Load prompt configuration
    ReasonPrompt-->>CopilotExtension: agent=visible-reasoning

    CopilotExtension->>VisibleReasoningAgent: Invoke with problem description
    VisibleReasoningAgent->>AGIProvider: create_agi_provider(enable_chain_of_thought=true,\nverbose=true, enable_self_reflection=true,\nenable_task_decomposition=true, reasoning_depth=3)

    AGIProvider->>LLM: Send request with reasoning enabled
    LLM-->>AGIProvider: Reasoning_steps + final_answer

    AGIProvider-->>VisibleReasoningAgent: Structured reasoning_steps + outcome

    VisibleReasoningAgent-->>CopilotExtension: Response with Analyze, Decompose, Execute, Reflect, Synthesize phases
    CopilotExtension-->>Developer: Display full visible chain_of_thought response
Loading

Class diagram for AGI provider and the visible-reasoning agent behavior

classDiagram
    class VisibleReasoningAgent {
        +string name
        +string description
        +list tools
        +bool exposes_chain_of_thought
        +bool is_temporary_specialist
        +create_handoff_summary(string outcome, string decision, string assumptions, string risks, string next_action) string
    }

    class AGIProvider {
        +bool enable_chain_of_thought
        +bool enable_self_reflection
        +bool enable_task_decomposition
        +int reasoning_depth
        +bool verbose
        +AGIContext context
        +generate_response(string input) string
    }

    class AGIContext {
        +list conversation_history
        +list reasoning_chains
        +list goals
        +list learned_patterns
        +add_step(ReasoningStep step) void
    }

    class ReasoningStep {
        +string step_type
        +string content
        +float confidence
        +map metadata
    }

    VisibleReasoningAgent --> AGIProvider : configures
    AGIProvider o-- AGIContext : uses
    AGIContext o-- ReasoningStep : aggregates

    class AGIProviderVisible {
        +bool enable_chain_of_thought = true
        +bool enable_self_reflection = true
        +bool enable_task_decomposition = true
        +int reasoning_depth = 3
        +bool verbose = true
    }

    class AGIProviderInternal {
        +bool enable_chain_of_thought = true
        +bool enable_self_reflection = true
        +bool enable_task_decomposition = true
        +int reasoning_depth = 3
        +bool verbose = false
    }

    AGIProviderVisible --|> AGIProvider
    AGIProviderInternal --|> AGIProvider

    class AGIReasoningAgent {
        +bool exposes_chain_of_thought = false
    }

    AGIReasoningAgent --> AGIProviderInternal : uses
    VisibleReasoningAgent --> AGIProviderVisible : uses
Loading

File-Level Changes

Change Details Files
Add a dedicated visible-reasoning agent with an explicit "show your work" contract and five-phase reasoning pipeline.
  • Create new visible-reasoning agent metadata with descriptive name, long-form description, and trigger phrases oriented around explicit reasoning exposure.
  • Grant the agent the same tool set as other AGI-style agents (edit/search/execute/web/etc.) to support full-stack reasoning workflows.
  • Define a detailed visible reasoning protocol that enforces Analyze → Decompose → Execute → Reflect → Synthesize phases in every response, including formatting rules and heuristics.
  • Specify a return-to-primary-agent handoff contract to keep this agent scoped to reasoning and delegate execution/orchestration back to the main agent.
  • Document integration expectations with the existing AGI provider and reasoning pipeline (e.g., enabling verbose reasoning output).
.github/agents/visible-reasoning.agent.md
Route the Reason prompt to the new visible-reasoning agent and clarify that it exposes chain-of-thought in output.
  • Update the Reason prompt description to emphasize visible chain-of-thought and explicit reasoning steps in responses.
  • Switch the prompt configuration from using the agi-reasoning agent to the new visible-reasoning agent.
.github/prompts/reason.prompt.md
Clarify Copilot agent and prompt documentation to distinguish internal vs visible chain-of-thought behaviors.
  • Refine the agi-reasoning agent description to state that its chain-of-thought is internal and only final answers are exposed.
  • Add visible-reasoning to the agents table with a purpose description focused on visible, step-by-step reasoning.
  • Update the reason.prompt.md entry in the prompts list to describe its visible chain-of-thought behavior and link it conceptually to the new agent.
.github/copilot-instructions.md

Assessment against linked issues

Issue Objective Addressed Explanation
#182 Eliminate conflicting guidance about whether the agi-reasoning agent exposes chain-of-thought by clearly defining it as internal-only and separating visible reasoning behavior.
#182 Introduce a dedicated agent for visible, step-by-step chain-of-thought reasoning (including its agent definition and behavior description).
#182 Update prompts and documentation so that reason.prompt.md uses the new visible reasoning agent, and copilot-instructions.md accurately reflects which prompts/agents expose vs. hide chain-of-thought.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The visible-reasoning spec hard-requires all five phases for every request; consider explicitly allowing a collapsed or abbreviated flow for trivial/simple queries to avoid overly verbose responses that may frustrate users.
  • The Return-to-Agent Contract assumes an agent orchestrator will always be present; it may be worth clarifying how this behaves when visible-reasoning is invoked directly (e.g., from reason.prompt.md) to avoid confusing or redundant handoff text in user-facing output.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `visible-reasoning` spec hard-requires all five phases for every request; consider explicitly allowing a collapsed or abbreviated flow for trivial/simple queries to avoid overly verbose responses that may frustrate users.
- The `Return-to-Agent Contract` assumes an `agent` orchestrator will always be present; it may be worth clarifying how this behaves when `visible-reasoning` is invoked directly (e.g., from `reason.prompt.md`) to avoid confusing or redundant handoff text in user-facing output.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated visible-reasoning agent and routes reason.prompt.md to it, resolving contradictory “show reasoning” vs “hide reasoning” guidance when reason.prompt.md and agi.prompt.md previously shared the same agi-reasoning agent.

Changes:

  • Adds .github/agents/visible-reasoning.agent.md defining a visible step-by-step reasoning contract.
  • Updates .github/prompts/reason.prompt.md to use agent: visible-reasoning and adjusts its description accordingly.
  • Updates .github/copilot-instructions.md to document both agents distinctly and clarifies that reason.prompt.md uses visible-reasoning.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/prompts/reason.prompt.md Switches the prompt’s agent to visible-reasoning and updates the prompt description to match visible reasoning.
.github/copilot-instructions.md Documents the new agent and clarifies the intended hidden vs visible reasoning split across prompts/agents.
.github/agents/visible-reasoning.agent.md Adds the new visible reasoning agent definition and its “Show Your Work” contract.

Comment on lines +2 to +3
name: visible-reasoning
description: "Visible step-by-step reasoning agent. Specializes in showing explicit chain-of-thought analysis, task decomposition, and structured reasoning to the user — every reasoning step is exposed in the response.\n\nTrigger phrases include:\n- 'show your reasoning'\n- 'walk me through your thinking'\n- 'explain step by step'\n- 'think through this out loud'\n- 'reason through this with me'\n- 'show all steps'\n- 'transparent reasoning'\n\nExamples:\n- User says 'walk me through your reasoning on this architecture decision' → invoke to expose each reasoning step\n- User asks 'explain step by step how you would debug this' → invoke for visible decomposition and analysis\n- User says 'think through this out loud' → invoke to surface all analysis and decision steps in the response\n\nDifference from agi-reasoning: agi-reasoning keeps chain-of-thought internal (only delivers the final answer). This agent surfaces reasoning explicitly so the user can follow, verify, and learn from each step."

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The front-matter description claims agi-reasoning keeps chain-of-thought internal and "only delivers the final answer", but .github/agents/agi-reasoning.agent.md does not currently state that constraint. Consider either updating agi-reasoning.agent.md to explicitly require hidden reasoning (to match this statement) or softening this wording here so it doesn’t assert behavior the agent definition doesn’t guarantee.

Copilot uses AI. Check for mistakes.
Comment thread .github/agents/visible-reasoning.agent.md
Comment thread .github/copilot-instructions.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bryan <74067792+Bryan-Roe@users.noreply.github.com>
@Bryan-Roe Bryan-Roe self-requested a review as a code owner May 9, 2026 05:49
Bryan-Roe and others added 2 commits May 8, 2026 22:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bryan <74067792+Bryan-Roe@users.noreply.github.com>
Signed-off-by: Bryan <74067792+Bryan-Roe@users.noreply.github.com>
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA aae877f.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@Bryan-Roe Bryan-Roe merged commit 87d8b50 into main May 9, 2026
29 of 35 checks passed
@Bryan-Roe Bryan-Roe deleted the copilot/fix-conflicting-agent-description-again branch May 9, 2026 05:50
## Workspace Context

- **Provider chain**: Azure OpenAI → OpenAI → LMStudio → LoRA → Local
- **Provider chain**: explicit choice → LM Studio → Ollama → AGI → Quantum → Azure OpenAI → OpenAI → Local fallback → LoRA (source of truth: `detect_provider()` in `ai-projects/chat-cli/src/chat_providers.py`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified an issue in your code:
Possibly found usage of AI: OpenAI

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by detect-generic-ai-oai.

You can view more details about this finding in the Semgrep AppSec Platform.

@bryan-roe-bot

bryan-roe-bot Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Semgrep found 1 detect-generic-ai-oai finding:

  • .github/agents/visible-reasoning.agent.md

Possibly found usage of AI: OpenAI

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aae877fa9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Data: read-only `datasets/`, write-only `data_out/`
- Always `--dry-run` orchestrators first
- Test: `python scripts/test_runner.py --unit`
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize Markdown line endings to LF

This commit rewrites every line in this Markdown file using CRLF (\r\n) without changing content, which creates a no-op full-file diff and unnecessary churn; the same issue also appears in .github/copilot-instructions.md. Because the repo’s .gitattributes specifies *.md text eol=lf, committing CRLF here undermines that policy and makes future blame/merge review noisier for no functional gain.

Useful? React with 👍 / 👎.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

3 participants