fix(plugin): don't record false success when gt plugin run only prints instructions
The `gt plugin run` command was recording a "success" run even though it only prints plugin instructions for an agent/user to execute - it doesn't actually run the plugin. This poisoned the cooldown gate: CountRunsSince counted these false successes, preventing actual executions from running because the gate appeared to have recent successful runs. Remove the recording from `gt plugin run`. The actual plugin execution (by whatever follows the printed instructions) should record the result. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -433,19 +433,10 @@ func runPluginRun(cmd *cobra.Command, args []string) error {
|
|||||||
fmt.Printf("%s\n", style.Bold.Render("Instructions:"))
|
fmt.Printf("%s\n", style.Bold.Render("Instructions:"))
|
||||||
fmt.Println(p.Instructions)
|
fmt.Println(p.Instructions)
|
||||||
|
|
||||||
// Record the run
|
// NOTE: We intentionally do NOT record a run here. This command only prints
|
||||||
recorder := plugin.NewRecorder(townRoot)
|
// instructions for an agent/user to execute - it doesn't actually run the plugin.
|
||||||
beadID, err := recorder.RecordRun(plugin.PluginRunRecord{
|
// Recording "success" here would poison the cooldown gate, preventing real executions.
|
||||||
PluginName: p.Name,
|
// The actual execution (by whatever follows these instructions) should record the result.
|
||||||
RigName: p.RigName,
|
|
||||||
Result: plugin.ResultSuccess, // Manual runs are marked success
|
|
||||||
Body: "Manual run via gt plugin run",
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Warning: failed to record run: %v\n", err)
|
|
||||||
} else {
|
|
||||||
fmt.Printf("\n%s Recorded run: %s\n", style.Dim.Render("●"), beadID)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user