File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ func (h *Handlers) Run(ctx context.Context, detached bool) error {
6666// fetchAgentInstructions asks the server for training-specific agent instructions
6767// (content for CLAUDE.md / AGENTS.md). Returns nil when the training has none.
6868// On codes.Unimplemented (old server) it logs a warning and returns nil.
69+ // On codes.NotFound (training has no instructions registered) it silently returns nil.
6970func (h * Handlers ) fetchAgentInstructions (ctx context.Context , trainingRootFs * afero.BasePathFs ) ([]byte , error ) {
7071 cfg := h .config .TrainingConfig (trainingRootFs )
7172
@@ -74,9 +75,13 @@ func (h *Handlers) fetchAgentInstructions(ctx context.Context, trainingRootFs *a
7475 Token : h .config .GlobalConfig ().Token ,
7576 })
7677 if err != nil {
77- if status .Code (err ) == codes .Unimplemented {
78+ switch status .Code (err ) {
79+ case codes .Unimplemented :
7880 logrus .Warn ("Server does not support agent instructions, skipping AI companion setup" )
7981 return nil , nil
82+ case codes .NotFound :
83+ // Training has no agent instructions registered — that's fine, they're optional.
84+ return nil , nil
8085 }
8186 return nil , errors .Wrap (err , "fetching agent instructions" )
8287 }
You can’t perform that action at this time.
0 commit comments