Skip to content

refactor(web): rename agent workspace files → context to match budagent#52

Open
dittops wants to merge 2 commits into
mainfrom
feature/cli-agent-prompt-cleanup
Open

refactor(web): rename agent workspace files → context to match budagent#52
dittops wants to merge 2 commits into
mainfrom
feature/cli-agent-prompt-cleanup

Conversation

@dittops
Copy link
Copy Markdown
Member

@dittops dittops commented May 7, 2026

Summary

  • Companion to BudEcosystem/bda#29. The budagent rename moves the agent's prompt-context surface (AGENTS / SOUL / USER / MEMORY) from "workspace" to "context" everywhere — the previous name was overloaded with Rust workspaces, exec sandbox dirs, etc.
  • This PR flips the frontend to match: type names, fetch URLs, LLM tool catalog entries, UI labels.
  • Must land in lockstep with bda#29 — the frontend will 404 against the old /api/agent/workspace-files paths after the backend deploy.

Renames (breaking, no back-compat)

File Change
components/desktop/AgentConfigView.tsx interface WorkspaceFileAgentContextFile; 4 fetch URLs /api/agent/workspace-files[/{path}]/api/agent/context[/{path}]; UI strings "Workspace Files" → "Context Files"
lib/agent/tools/local-execution.ts syncWorkspaceFileToBackendsyncAgentContextFileToBackend; fetch URL → /api/agent/context
lib/agent/tools/tool-catalog.ts tool name fields workspace_read/write/listcontext_read/write/list; descriptions reworded
app/api/local-agent/{execute,cron-tool-execute}/route.ts imports + call sites renamed; comments updated

Untouched (separate concept)

  • workspace_path / workspacePath on session payloads — that's the agent's session working directory, not the prompt-context files. Lives in gateway.ts, executor.ts, session-client.ts, BudAgentScreen.tsx, etc. Unaffected.
  • SandboxPolicy::WorkspaceWrite / "workspace-write" enum values in cli-agent-tool.ts — Codex CLI sandbox-policy concept.
  • Generic Slack/Asana/Bitbucket "workspace" product names in lib/connectors/connectors.tsx.
  • Admin-page copy ("Manage general settings applicable to all users in the workspace") — generic product language.

Verification

  • Edited files clean under pnpm tsc --noEmit (31 pre-existing errors elsewhere, all unrelated)
  • Lint clean on touched directories
  • Manual smoke recommended after merge: open AgentConfigView, edit a context file, start a chat, confirm context_* tool calls round-trip

Test plan

  • BudEcosystem/bda#29 lands first (or simultaneously); confirm no traffic to old /api/agent/workspace-files after rollout
  • Open the Agent Config (Context Files) panel — verify list/read/write all work end-to-end
  • Start a fresh chat, ask the agent to "list your context files" — verify it calls the new context_list tool name
  • Cron-tool execute path: schedule a quick job that touches context, confirm syncAgentContextFileToBackend flushes correctly

🤖 Generated with Claude Code

Companion to BudEcosystem/bda#29. The budagent rename moves the agent's
prompt-context surface from "workspace" to "context" everywhere it
referred to the AGENTS / SOUL / USER / MEMORY layer (the previous name
was overloaded with Rust workspaces, exec sandbox dirs, etc.).

Frontend changes — breaking, no back-compat:

- AgentConfigView.tsx
  * interface WorkspaceFile          → AgentContextFile
  * fetch URLs `/api/agent/workspace-files[/{path}]`
                                     → `/api/agent/context[/{path}]`
  * UI strings "Workspace Files" / error toasts → "Context Files"

- lib/agent/tools/local-execution.ts
  * syncWorkspaceFileToBackend       → syncAgentContextFileToBackend
  * fetch URL                        → `/api/agent/context`

- lib/agent/tools/tool-catalog.ts
  * tool names workspace_read / workspace_write / workspace_list
                                     → context_read / context_write / context_list
  * descriptions reworded to "context file(s)"

- app/api/local-agent/{execute,cron-tool-execute}/route.ts
  * import + call site renamed to syncAgentContextFileToBackend
  * comments updated

Untouched (separate concept): `workspace_path` / `workspacePath` on
session payloads — that's the agent's session working directory, not
the prompt-context files. Also untouched: SandboxPolicy enum values
in cli-agent-tool.ts (`workspace-write`), generic Slack/Asana
"workspace" product names.

Verified: edited files clean under `pnpm tsc --noEmit` (31 pre-existing
errors elsewhere, all unrelated). Lint clean on touched dirs.

Must land in lockstep with BudEcosystem/bda#29 — frontend will 404
against the old `/api/agent/workspace-files` paths after the backend
deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames 'workspace files' to 'context files' across the codebase to ensure consistent terminology. The changes involve updating API endpoints from /api/agent/workspace-files to /api/agent/context, renaming internal functions and interfaces such as syncWorkspaceFileToBackend and WorkspaceFile, and modifying tool names in the catalog (e.g., workspace_read to context_read). I have no feedback to provide.

…mpt-cleanup

# Conflicts:
#	web/src/app/api/local-agent/execute/route.ts
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