Skip to content

[BUG] AI rule authoring: read_rule_file resolves relative path against process working directory #754

Description

@tangcent

Describe the bug
When using the AI rule authoring assistant (Rules tab → Chat/Magic), the read_rule_file tool is invoked with a relative path (e.g. .easy.api.properties), but the tool resolves it against the process working directory instead of the project directory. As a result, the agent cannot read the existing rule file content and generates rules without seeing the current configuration.

To Reproduce
Steps to reproduce the behavior:

  1. Open Settings → EasyApi → Rules.
  2. Open the AI rule authoring assistant (Chat/Magic).
  3. Ask the agent to review or modify the existing project rule file.
  4. Observe the read_rule_file tool call.

Expected behavior
The read_rule_file tool should resolve relative paths against the project directory so the agent can read the actual rule file content.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows
  • IDE: IntelliJ IDEA 2025.3
  • Plugin Version: 3.2.3.252.0

Additional context
Log output from the AI agent (paths redacted):

read_rule_file args={"path":".easy.api.properties"}
read_rule_file -> text(len=0)   # empty result
read_rule_file -> error ... failed to read .easy.api.properties: <cwd>/.easy.api.properties

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions