Skip to content
Closed
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
39 changes: 39 additions & 0 deletions cmd/entire/cli/agent/pi/pi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package pi

import (
"context"
"path/filepath"

"github.com/entireio/cli/cmd/entire/cli/agent"
"github.com/entireio/cli/cmd/entire/cli/session"
)

type PiAgent struct{}

func NewPiAgent() *PiAgent {
return &PiAgent{}
}

func (a *PiAgent) Name() string {
return "Pi"
}

func (a *PiAgent) Detect(ctx context.Context, repoRoot string) (bool, error) {
// Pi usually has a ~/.pi directory or project local .pi
// Simplified detection for skeleton
return true, nil
}
Copy link

Choose a reason for hiding this comment

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

Detect unconditionally returns true for all repos

Medium Severity

The Detect method (intended as DetectPresence) always returns true, nil regardless of whether the Pi agent is actually installed. The comment mentions checking for ~/.pi or .pi directories, but no such check is performed. In the Detect() function in registry.go, all registered agents are iterated and the first one whose DetectPresence returns true is selected — so an always-true implementation would cause Pi to be incorrectly auto-detected as the active agent in every repository.

Fix in Cursor Fix in Web


func (a *PiAgent) InstallHooks(ctx context.Context, repoRoot string) error {
return nil
}

func (a *PiAgent) UninstallHooks(ctx context.Context, repoRoot string) error {
return nil
}

func (a *PiAgent) ReadSession(ctx context.Context, sessionID string) (*agent.SessionMetadata, error) {
return &agent.SessionMetadata{
SessionID: sessionID,
}, nil
}
Copy link

Choose a reason for hiding this comment

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

PiAgent methods don't match the Agent interface

High Severity

PiAgent's method signatures don't match the Agent interface defined in agent.go. Name() returns string instead of AgentName; Detect(ctx, repoRoot) should be DetectPresence() (bool, error); ReadSession takes (ctx, sessionID) and returns *agent.SessionMetadata (which doesn't exist) instead of taking *HookInput and returning *AgentSession; InstallHooks/UninstallHooks have wrong signatures. Many required interface methods (Type(), Description(), GetHookConfigPath(), SupportsHooks(), etc.) are entirely missing. The agent also lacks the init() registration call that other agents use to register with the agent system.

Fix in Cursor Fix in Web