Skip to content

Refactor: Unify agent context reads to persistent workspace (AGENT_DATA_DIR) #189

Open
Congregalis wants to merge 1 commit intodataelement:mainfrom
Congregalis:refactor/unify-agent-data-root
Open

Refactor: Unify agent context reads to persistent workspace (AGENT_DATA_DIR) #189
Congregalis wants to merge 1 commit intodataelement:mainfrom
Congregalis:refactor/unify-agent-data-root

Conversation

@Congregalis
Copy link
Contributor

Summary

tool_dir (/tmp/clawith_workspaces) is effectively deprecated in current backend behavior.
Agent data writes no longer target that directory; they consistently go to AGENT_DATA_DIR/<agent_id>.
AGENT_DATA_DIR is always available because it has a configured default even when users do not set it explicitly.

Given this, keeping hardcoded reads from /tmp/clawith_workspaces in context/heartbeat creates unnecessary inconsistency. This PR removes that dependency and aligns reads with the actual write path.

What Changed

  • Removed hardcoded /tmp/clawith_workspaces dependency from context assembly.
  • Updated backend/app/services/agent_context.py to read agent files from the canonical persistent root only:
    AGENT_DATA_DIR/<agent_id>
  • Updated backend/app/services/heartbeat.py to read HEARTBEAT.md from:
    AGENT_DATA_DIR/<agent_id>/HEARTBEAT.md

Checklist

  • Tested locally
  • No unrelated changes included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant