From e691919148440e697b523efacef0df8f7b2086b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 10:50:18 +0000 Subject: [PATCH] docs: fix agentdrain and constants package specs - agentdrain: remove non-existent ClusterCount() method, add Train() docs - constants: add OpenCodeEngine and related env var constants (OpenCode engine added) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/agentdrain/README.md | 8 +++++--- pkg/constants/README.md | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pkg/agentdrain/README.md b/pkg/agentdrain/README.md index 48de24e7f9b..3cb1040acda 100644 --- a/pkg/agentdrain/README.md +++ b/pkg/agentdrain/README.md @@ -105,15 +105,17 @@ The single-stage Drain miner. Processes one pipeline stage at a time. cfg := agentdrain.DefaultConfig() miner, err := agentdrain.NewMiner(cfg) -// Training phase — call for known-good events +// Process a raw log line (training + matching in one step) +result, err := miner.Train(rawLogLine) + +// Training phase — call for structured events from known-good runs result, err := miner.TrainEvent(evt) -// Analysis phase — call for events to check +// Analysis phase — call for events to check for anomalies result, report, err := miner.AnalyzeEvent(evt) // Inspect clusters clusters := miner.Clusters() -count := miner.ClusterCount() ``` #### Persistence diff --git a/pkg/constants/README.md b/pkg/constants/README.md index a46e282796a..b9cbc81c785 100644 --- a/pkg/constants/README.md +++ b/pkg/constants/README.md @@ -22,7 +22,7 @@ The package uses typed aliases to prevent mixing unrelated string or integer val | Type | Description | Example constant | |------|-------------|-----------------| -| `EngineName` | AI engine identifier | `CopilotEngine`, `ClaudeEngine`, `CodexEngine`, `GeminiEngine` | +| `EngineName` | AI engine identifier | `CopilotEngine`, `ClaudeEngine`, `CodexEngine`, `GeminiEngine`, `OpenCodeEngine`, `CrushEngine` | | `FeatureFlag` | Feature flag identifier | `MCPGatewayFeatureFlag`, `MCPScriptsFeatureFlag` | | `JobName` | GitHub Actions job name | `AgentJobName`, `ActivationJobName` | | `StepID` | GitHub Actions step identifier | `CheckMembershipStepID`, `CheckRateLimitStepID` | @@ -43,15 +43,16 @@ All semantic types implement `String() string` and `IsValid() bool` methods. import "github.com/github/gh-aw/pkg/constants" // Engine names -constants.CopilotEngine // "copilot" -constants.ClaudeEngine // "claude" -constants.CodexEngine // "codex" -constants.GeminiEngine // "gemini" -constants.CrushEngine // "crush" -constants.DefaultEngine // "copilot" +constants.CopilotEngine // "copilot" +constants.ClaudeEngine // "claude" +constants.CodexEngine // "codex" +constants.GeminiEngine // "gemini" +constants.OpenCodeEngine // "opencode" +constants.CrushEngine // "crush" +constants.DefaultEngine // "copilot" // All supported engine names -constants.AgenticEngines // []string{"claude", "codex", "copilot", "gemini", "crush"} +constants.AgenticEngines // []string{"claude", "codex", "copilot", "gemini", "opencode", "crush"} // Get engine metadata opt := constants.GetEngineOption("copilot") @@ -94,11 +95,13 @@ constants.EnvVarModelAgentClaude // "GH_AW_MODEL_AGENT_CLAUDE" constants.EnvVarModelAgentCodex // "GH_AW_MODEL_AGENT_CODEX" constants.EnvVarModelAgentCustom // "GH_AW_MODEL_AGENT_CUSTOM" constants.EnvVarModelAgentGemini // "GH_AW_MODEL_AGENT_GEMINI" +constants.EnvVarModelAgentOpenCode // "GH_AW_MODEL_AGENT_OPENCODE" constants.EnvVarModelAgentCrush // "GH_AW_MODEL_AGENT_CRUSH" constants.EnvVarModelDetectionCopilot// "GH_AW_MODEL_DETECTION_COPILOT" constants.EnvVarModelDetectionClaude // "GH_AW_MODEL_DETECTION_CLAUDE" constants.EnvVarModelDetectionCodex // "GH_AW_MODEL_DETECTION_CODEX" constants.EnvVarModelDetectionGemini // "GH_AW_MODEL_DETECTION_GEMINI" +constants.EnvVarModelDetectionOpenCode // "GH_AW_MODEL_DETECTION_OPENCODE" constants.EnvVarModelDetectionCrush // "GH_AW_MODEL_DETECTION_CRUSH" // Native CLI model env vars (passed directly to the engine CLI) @@ -107,6 +110,7 @@ constants.CopilotCLIIntegrationIDEnvVar // "GITHUB_COPILOT_INTEGRATION_ID" constants.ClaudeCLIModelEnvVar // "ANTHROPIC_MODEL" constants.GeminiCLIModelEnvVar // "GEMINI_MODEL" constants.CrushCLIModelEnvVar // "CRUSH_MODEL" +constants.OpenCodeCLIModelEnvVar // "OPENCODE_MODEL" // gh-aw runtime env vars constants.EnvVarPrompt // "GH_AW_PROMPT"