Skip to content

speckit.clarify Agent Requests /root Access Instead of Project Root #1540

@kenuw

Description

@kenuw

So this may be a fluke but wanted to raise an issue anyway since it regards /root access request by speckit.clarify. Please see the AI summary below. Thx -Ken

Bug Report: speckit.clarify Agent Requests /root Access Instead of Project Root

Environment

  • GitHub Copilot CLI Version: 0.0.396
  • Operating System: WSL - Ubuntu 24.04
  • Project Directory: /home/user/projects/my-project
  • Date Encountered: 2026-01-30

Summary

The speckit.clarify agent attempts to execute a prerequisites check script using /root as the working directory instead of the actual project root directory. This triggers a permission prompt that users must reject, though the agent continues to function correctly afterward.

Steps to Reproduce

  1. Navigate to a project directory (e.g., /home/user/projects/my-project)
  2. Ensure a spec exists at specs/001-feature-name/spec.md
  3. Execute the command: /speckit.clarify
  4. Provide answers to clarification questions (reached Question 5 in our case)
  5. After answering the final question, the agent attempts to run a prerequisites check

Expected Behavior

The agent should execute its prerequisites check script using the actual project root directory:

cd /home/user/projects/my-project && .specify/scripts/bash/check-prerequisites.sh --json --paths-only

Actual Behavior

The agent attempts to execute:

cd /root && .specify/scripts/bash/check-prerequisites.sh --json --paths-only

This results in a permission prompt that requires user intervention:

✗ Speckit.clarify: Complete clarification workflow
 ✗ Run prerequisites check to get feature paths
   $ cd /root && .specify/scripts/bash/check-prerequisites.sh --json --paths-only
   The user rejected this tool call.

Impact

  • Severity: Medium
  • User Experience: Users must reject the permission prompt, creating confusion and concern about security
  • Functionality: Despite the error, the agent completes its work successfully - the spec file was correctly updated with all clarifications
  • Workaround: Users can reject the /root access prompt and the agent will still complete the task

Additional Context

The agent successfully completed all clarification tasks:

  • Recorded 5 clarification questions and answers
  • Updated the spec file (specs/001-feature-name/spec.md) with appropriate changes
  • Removed implementation-specific references and made the spec more technology-agnostic

The error only occurred during what appears to be a final cleanup or validation step.

Related Environment Details

Session Context:

  • Session folder: /home/user/.copilot/session-state/<session-uuid>
  • Git repository root: /home/user/projects/my-project
  • Current working directory: /home/user/projects/my-project

Suggested Fix

The agent should use the detected git repository root or current working directory instead of hardcoded /root path. The project root detection logic should respect the environment context that Copilot CLI already establishes:

# Current (incorrect)
cd /root && .specify/scripts/bash/check-prerequisites.sh

# Should be
cd $PROJECT_ROOT && .specify/scripts/bash/check-prerequisites.sh
# or
cd $GIT_ROOT && .specify/scripts/bash/check-prerequisites.sh

Logs

Error message when attempting to read session output:

Invalid session ID: speckit.clarify. Please supply a valid session ID to read output from.

<no active sessions>

This suggests the agent subprocess may have terminated after the failed prerequisites check, though the spec modifications were successfully committed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions