Conversation
❌ Deploy Preview for agent-runtimes failed.
|
There was a problem hiding this comment.
Pull request overview
This PR performs a terminology rename across the codebase, replacing the old "AgentSpace" / "agent space" terminology with the current "Agent Runtime" / "agent runtime" naming. Additionally, it introduces two new hooks (useAgentRuntimes.ts and useAgentStore.ts) that wrap the Datalayer runtimes service cache and expose a centralized Zustand store for agent specs and running agents.
Changes:
- Rename all occurrences of "AgentSpace/agent space" to "Agent Runtime/agent runtime" in comments and docstrings across TypeScript, Python, and codegen files.
- Add
useAgentRuntimes.ts: new hooks that delegate to@datalayer/core/lib/hookscache for fetching/creating/deleting agent runtimes from the K8s backend. - Add
useAgentStore.ts: new centralized Zustand store holding the static agent spec catalogue and the live running agents list, with spec enrichment logic insetRunningAgents.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/Types.ts |
Updated AgentSpec docstring: "AgentSpace" → "Agent Runtime" |
src/specs/agents/mocks/agents.ts |
Updated autogenerated comment: "AgentSpaces" → "Agent Runtimes" |
src/specs/agents/datalayer-ai/agents.ts |
Updated autogenerated comment: "AgentSpaces" → "Agent Runtimes" |
src/specs/agents/codemode-paper/agents.ts |
Updated autogenerated comment: "AgentSpaces" → "Agent Runtimes" |
src/specs/agents/codeai/agents.ts |
Updated autogenerated comment: "AgentSpaces" → "Agent Runtimes" |
src/hooks/useAgentStore.ts |
New Zustand store for agent specs catalog + running agent runtimes |
src/hooks/useAgentRuntimes.ts |
New hooks delegating to useCache for runtime CRUD operations; defines AgentRuntimeData type |
src/hooks/index.ts |
Exports the two new hook modules |
src/components/chat/store/conversationStore.ts |
Updated comments: "agent space" → "agent runtime" |
src/components/chat/components/base/ChatBase.tsx |
Updated comments: "agent spaces" → "agent runtimes" |
src/components/chat/components/Chat.tsx |
Updated comment: "agent spaces" → "agent runtimes" |
src/components/McpServerManager.tsx |
Updated docstring: "agent spaces" → "agent runtimes" |
scripts/codegen/generate_agents.py |
Updated codegen templates: "AgentSpaces" → "agent runtimes" |
agent_runtimes/types/types.py |
Updated Python docstrings: "agent space" → "agent runtime" |
agent_runtimes/specs/agents/mocks/agents.py |
Updated autogenerated comment |
agent_runtimes/specs/agents/datalayer_ai/agents.py |
Updated autogenerated comment |
agent_runtimes/specs/agents/codemode_paper/agents.py |
Updated autogenerated comment |
agent_runtimes/specs/agents/codeai/agents.py |
Updated autogenerated comment |
src/hooks/useAgentRuntimes.ts
Outdated
| url?: string; | ||
| token?: string; | ||
| // Agent specification with suggestions for chat UI | ||
| agentSpec?: Record<string, any>; |
There was a problem hiding this comment.
The agentSpec field in AgentRuntimeData is typed as Record<string, any>, but in useAgentStore.ts the setRunningAgents mutator assigns a fully-typed AgentSpec object to this field (line 61: return spec ? { ...agent, agentSpec: spec } : agent). The weak Record<string, any> type means TypeScript will not provide proper autocomplete or catch type errors when consumers of runningAgents access agentSpec fields. The type should be AgentSpec | undefined (using the imported AgentSpec from ../types/Types) rather than Record<string, any>. Note this would require importing AgentSpec in useAgentRuntimes.ts as well.
scripts/codegen/generate_agents.py
Outdated
| * Agent Library. | ||
| * | ||
| * Predefined agent specifications that can be instantiated as AgentSpaces. | ||
| * Predefined agent specifications that can be instantiated as agent runtimes. |
There was a problem hiding this comment.
The codegen template in generate_agents.py uses lowercase "agent runtimes" (line 365 for TypeScript, line 78 for Python), but the auto-generated TypeScript files in this PR were manually updated to use title case "Agent Runtimes". If the codegen script is re-run in the future, the TypeScript files will revert to lowercase "agent runtimes", introducing inconsistency. The template at line 365 should match what was manually set in the TypeScript files (i.e., use "Agent Runtimes" with title case if that's the intended naming convention).
| * Predefined agent specifications that can be instantiated as agent runtimes. | |
| * Predefined agent specifications that can be instantiated as Agent Runtimes. |
No description provided.