Skip to content

feat: inject git excludes for agent working directories before container runs #81

@eshulman2

Description

@eshulman2

Problem

The agent inside the container may create scratch directories or temporary files during execution. Forge currently only excludes task.json (cleaned up at runtime). If git picks up other agent-internal paths, they can appear in commits or dirty the workspace state.

Proposed solution

Before spawning the container, append known agent-internal paths to {workspace}/.git/info/exclude:

.forge/

This is a local-only write (not a git commit) and has no effect on the remote. It ensures git status and git add inside the container never accidentally pick up forge metadata.

Extend the list if other agent working directories are identified over time.

Reference

Learned from fullsend: internal/cli/run.go:excludeAgentWorkingDirs() — appends .agentready/ and .fullsend-workspace/ to .git/info/exclude before agent runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions