fix: pass workspace from YAML import to agent definition#35
Conversation
When importing a project via YAML, the workspace was parsed and stored in the normalized spec but never bound to the agent. The AgentDefinition.WorkspaceID was always empty, so agents started in an empty directory. Resolve workspace from agent-level spec first, falling back to project-level. Generate a deterministic workspace ID from the spec fields so repeated imports do not create duplicates. Fixes chaitin#33
|
Thanks for the fix. The direction makes sense to me: YAML-imported managed agents should not lose the workspace declared in the project spec, especially when the managed agent is started outside the project-run path. One thing I am not fully sure about from this patch: Project runs already seem to materialize workspace from the project revision spec at run time, so this mainly matters for using the imported managed agent through the normal agent-definition/session path. Could we confirm that the matching workspace config is persisted somewhere, or add that as part of this change? A regression test that applies a project with project-level + agent-level workspace and then verifies the managed agent workspace resolves successfully would make this much clearer. |
Summary
When importing a project via YAML, the workspace was parsed and stored in the normalized spec but never bound to the agent.
AgentDefinition.WorkspaceIDwas always empty, so agents started in an empty directory.Agent-level workspace takes precedence; project-level workspace is used as fallback.
Testing
go build ./pkg/compose/andgo build ./pkg/agentcompose/pass.Checklist
Fixes #33