Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,16 @@
fileAgents := make(map[string]project.AgentConfig)
fileAgentsByID := make(map[string]project.AgentConfig)
for _, agent := range theproject.Project.Agents {
key := normalAgentName(agent.Name, theproject.Project.IsPython()) + agent.Name
fileAgents[key] = agent
fileAgentsByID[agent.ID] = agent
}
key := normalAgentName(agent.Name, theproject.Project.IsPython())
if existing, ok := fileAgents[key]; ok {
logger.Warn(
"agent name collision: %q and %q normalize to %q; keeping first entry",
existing.Name, agent.Name, key,
)
continue
}
fileAgents[key] = agent
fileAgentsByID[agent.ID] = agent

agentFilename := rules.Filename
agentSrcDir := filepath.Join(theproject.Dir, theproject.Project.Bundler.AgentConfig.Dir)
Expand All @@ -407,18 +413,17 @@
state := make(map[string]agentListState)
for _, agent := range remoteAgents {
normalizedName := normalAgentName(agent.Name, theproject.Project.IsPython())
key := normalizedName + agent.Name
filename1 := filepath.Join(agentSrcDir, normalizedName, agentFilename)
filename2 := filepath.Join(agentSrcDir, agent.Name, agentFilename)
if util.Exists(filename1) {
state[key] = agentListState{
state[normalizedName] = agentListState{
Agent: &agent,
Filename: filename1,
FoundLocal: true,
FoundRemote: true,
}
} else if util.Exists(filename2) {
state[key] = agentListState{
state[normalizedName] = agentListState{
Agent: &agent,
Filename: filename2,
FoundLocal: true,
Expand All @@ -433,7 +438,7 @@
for _, filename := range localAgents {
agentName := filepath.Base(filepath.Dir(filename))
normalizedName := normalAgentName(agentName, theproject.Project.IsPython())
key := normalizedName + agentName
key := normalizedName
// var found bool
// for _, agent := range remoteAgents {
// if localAgent, ok := fileAgentsByID[agent.ID]; ok {
Expand Down Expand Up @@ -496,7 +501,7 @@

var wrappedPipe = "\n│"

func buildAgentTree(keys []string, state map[string]agentListState, project project.ProjectContext) (*tree.Tree, int, int, error) {

Check failure on line 504 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Test CLI Upgrade Path (macos-latest)

syntax error: unexpected name buildAgentTree, expected (

Check failure on line 504 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204-arm)

syntax error: unexpected name buildAgentTree, expected (

Check failure on line 504 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204)

syntax error: unexpected name buildAgentTree, expected (

Check failure on line 504 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (macos-latest)

syntax error: unexpected name buildAgentTree, expected (
agentSrcDir := filepath.Join(project.Dir, project.Project.Bundler.AgentConfig.Dir)
var root *tree.Tree
var files *tree.Tree
Expand Down Expand Up @@ -547,7 +552,7 @@
return root, localIssues, remoteIssues, nil
}

func showAgentWarnings(remoteIssues int, localIssues int, deploying bool) bool {

Check failure on line 555 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Test CLI Upgrade Path (macos-latest)

syntax error: unexpected name showAgentWarnings, expected (

Check failure on line 555 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204-arm)

syntax error: unexpected name showAgentWarnings, expected (

Check failure on line 555 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204)

syntax error: unexpected name showAgentWarnings, expected (

Check failure on line 555 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (macos-latest)

syntax error: unexpected name showAgentWarnings, expected (
issues := remoteIssues + localIssues
if issues > 0 {
var msg string
Expand Down Expand Up @@ -828,7 +833,7 @@
},
}

func init() {

Check failure on line 836 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Test CLI Upgrade Path (macos-latest)

syntax error: unexpected name init, expected (

Check failure on line 836 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204-arm)

syntax error: unexpected name init, expected (

Check failure on line 836 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (blacksmith-4vcpu-ubuntu-2204)

syntax error: unexpected name init, expected (

Check failure on line 836 in cmd/agent.go

View workflow job for this annotation

GitHub Actions / Build and Test (macos-latest)

syntax error: unexpected name init, expected (
rootCmd.AddCommand(agentCmd)
agentCmd.AddCommand(agentCreateCmd)
agentCmd.AddCommand(agentListCmd)
Expand Down
Loading