Problem
"WorkspaceContext" and the generated prompt prefix are constructed once when "MiniAgent" starts. However, tools such as "write_file", "patch_file", and "run_shell" can mutate the workspace during the same session.
As a result, subsequent model turns can receive stale information about:
- "git status"
- current branch state
- recent commits
- project documentation
- repository-level instructions
For example, the initial workspace may be clean, but after "write_file" creates a file, the prompt can still report the original clean status.
Expected behavior
After workspace-mutating operations, the agent should either:
- refresh the affected workspace context, or
- explicitly separate immutable context from dynamically refreshed state.
The refresh should avoid rebuilding unnecessary static prompt content on every turn.
Acceptance criteria
- "git status" reflects changes made during the current session.
- Changes made through "write_file", "patch_file", and shell commands are visible to later model turns.
- Project documentation changes are reflected when appropriate.
- Existing prompt/cache behavior is preserved as much as possible.
- Add regression tests covering a workspace mutation followed by another model turn.
Problem
"WorkspaceContext" and the generated prompt prefix are constructed once when "MiniAgent" starts. However, tools such as "write_file", "patch_file", and "run_shell" can mutate the workspace during the same session.
As a result, subsequent model turns can receive stale information about:
For example, the initial workspace may be clean, but after "write_file" creates a file, the prompt can still report the original clean status.
Expected behavior
After workspace-mutating operations, the agent should either:
The refresh should avoid rebuilding unnecessary static prompt content on every turn.
Acceptance criteria