Skip to content

bug: main agent does not load .pi/APPEND_SYSTEM.md in isolated runtime sessions #302

Description

@marcinkardas

Operating system(s)

  • Windows
  • macOS
  • Linux

What happened?

New Howcode main-agent sessions loaded AGENTS.md project context, but did not apply .pi/APPEND_SYSTEM.md. The project was trusted and the file existed, so APPEND_SYSTEM instructions should have been appended to the system prompt.

Suggested fix

Howcode isolated runtime creates its own DefaultResourceLoader in desktop/runtime/isolated-settings-manager.ts. In that path, AGENTS.md is loaded normally, but APPEND_SYSTEM.md is not forwarded when using the custom isolated setup.

Fix:

  • In createIsolatedRuntimeResourceLoader, detect trusted project .pi/APPEND_SYSTEM.md.
  • Pass it to DefaultResourceLoader via appendSystemPrompt.
  • Keep global APPEND_SYSTEM.md fallback.
  • Do not include project APPEND_SYSTEM.md when projectTrusted is false.
  • Add tests in desktop/runtime/isolated-settings-manager.test.ts for trusted and untrusted project APPEND_SYSTEM.md.

Expected code area:

  • desktop/runtime/isolated-settings-manager.ts
  • desktop/runtime/isolated-settings-manager.test.ts

Steps to reproduce

  1. Open a trusted project containing .pi/APPEND_SYSTEM.md and AGENTS.md.
  2. Start a new main-agent session in Howcode.
  3. Ask the agent about loaded project instructions or use a marker instruction from APPEND_SYSTEM.md.
  4. Observe that AGENTS.md is present, but APPEND_SYSTEM.md behavior is missing.

Agent implementation prompt

Investigate why Howcode main-agent isolated runtime sessions load AGENTS.md but do not apply .pi/APPEND_SYSTEM.md. Inspect the runtime resource loader setup and project trust path. Implement the smallest safe fix so trusted project APPEND_SYSTEM.md is passed into DefaultResourceLoader for isolated runtime sessions, while untrusted project APPEND_SYSTEM.md remains excluded. Add or update tests covering trusted and untrusted APPEND_SYSTEM loading.

App version or commit

0.1.66-dev

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions