MCPcopy Create free account
hub / github.com/github/gh-aw / Register

Method Register

pkg/workflow/agentic_engine.go:528–536  ·  view source on GitHub ↗

Register adds an engine to the registry. It returns an error if the engine has an invalid configuration (e.g., dedicatedLLMGatewayPort < 0).

(engine CodingAgentEngine)

Source from the content-addressed store, hash-verified

526// Register adds an engine to the registry. It returns an error if the engine
527// has an invalid configuration (e.g., dedicatedLLMGatewayPort < 0).
528func (r *EngineRegistry) Register(engine CodingAgentEngine) error {
529 type portProvider interface{ getDedicatedLLMGatewayPort() int }
530 if p, ok := engine.(portProvider); ok && p.getDedicatedLLMGatewayPort() < 0 {
531 return fmt.Errorf("engine '%s': dedicatedLLMGatewayPort must be >= 0, got %d", engine.GetID(), p.getDedicatedLLMGatewayPort())
532 }
533 agenticEngineLog.Printf("Registering engine: id=%s, name=%s", engine.GetID(), engine.GetDisplayName())
534 r.engines[engine.GetID()] = engine
535 return nil
536}
537
538// GetEngine retrieves an engine by ID
539func (r *EngineRegistry) GetEngine(id string) (CodingAgentEngine, error) {

Calls 5

GetIDMethod · 0.65
GetDisplayNameMethod · 0.65
ErrorfMethod · 0.45
PrintfMethod · 0.45