82e8c8905b
* feat: replace agent_type with agent_profile_id - Replace agent_type field with agent_profile_id across backend and frontend - Add ProfileResolver interface and StoreProfileResolver implementation - Update task creation/update to use agent_profile_id - Change default agent runtime from docker to standalone - Fix workspace state types to include all required fields - Fix websocket handlers type mismatches for environments, executors, workspaces - Update integration tests to use agent_profile_id * feat: pass model as CLI argument to agents - Add ModelFlag field to AgentTypeConfig for specifying the CLI flag - Set ModelFlag to '--model' for all agents (auggie, claude, codex, gemini, opencode, copilot) - Update launchStandalone to append model flag to agent command - Update launchDocker/buildContainerConfig to append model flag to container command - Model is passed when both agent supports ModelFlag and profile has Model configured * fix: make WebSocket message handling async to prevent blocking When a long-running handler like orchestrator.prompt was executing, it blocked the ReadPump loop, preventing other requests (like workspace.tree.get) from being processed until the handler completed. Now each message is handled in its own goroutine, allowing concurrent message handling so file tree requests work while the agent is working. * feat: show task description as first message in chat - Add 'Task' label with distinct styling (lighter background, border) - Pass taskDescription from page to TaskChatPanel component - Differentiate from regular user messages visually
46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
package lifecycle
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/kandev/kandev/internal/agent/settings/store"
|
|
)
|
|
|
|
// StoreProfileResolver implements ProfileResolver using the agent settings store
|
|
type StoreProfileResolver struct {
|
|
store store.Repository
|
|
}
|
|
|
|
// NewStoreProfileResolver creates a new profile resolver using the given store
|
|
func NewStoreProfileResolver(store store.Repository) *StoreProfileResolver {
|
|
return &StoreProfileResolver{store: store}
|
|
}
|
|
|
|
// ResolveProfile looks up an agent profile by ID and returns the profile info
|
|
func (r *StoreProfileResolver) ResolveProfile(ctx context.Context, profileID string) (*AgentProfileInfo, error) {
|
|
// Get the profile from the store
|
|
profile, err := r.store.GetAgentProfile(ctx, profileID)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("profile not found: %w", err)
|
|
}
|
|
|
|
// Get the parent agent to get the agent name
|
|
agent, err := r.store.GetAgent(ctx, profile.AgentID)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("agent not found for profile: %w", err)
|
|
}
|
|
|
|
return &AgentProfileInfo{
|
|
ProfileID: profile.ID,
|
|
ProfileName: profile.Name,
|
|
AgentID: agent.ID,
|
|
AgentName: agent.Name,
|
|
Model: profile.Model,
|
|
AutoApprove: profile.AutoApprove,
|
|
DangerouslySkipPermissions: profile.DangerouslySkipPermissions,
|
|
Plan: profile.Plan,
|
|
}, nil
|
|
}
|
|
|