Preserve manager skill bootstrap work

This commit is contained in:
2026-10-18 15:03:22 +01:00
parent 88595ebd55
commit ab9181eee9
13 changed files with 362 additions and 4 deletions
+14
View File
@@ -139,6 +139,20 @@ func (c *Chat) Sessions(ctx context.Context) ([]protocol.ChatSession, error) {
// It deliberately sends no model or permission override here: the endpoint's own
// defaults apply, exactly as the live check creates a session. The created
// session is returned with its directory lifted from location.directory.
// ActivateSkill uses the V2 experimental session skill endpoint. resume=false
// records the skill without starting an artificial turn; the first operator prompt
// is therefore the first model turn and receives the manager instructions.
func (c *Chat) ActivateSkill(ctx context.Context, id, skill string) error {
if !sessionID.MatchString(id) {
return fmt.Errorf("invalid OpenCode session id")
}
if strings.TrimSpace(skill) == "" {
return fmt.Errorf("empty OpenCode skill id")
}
_, err := c.call(ctx, "post", "/api/experimental/session/"+id+"/skill", map[string]any{"id": skill, "resume": false})
return err
}
func (c *Chat) Create(ctx context.Context, title, directory string) (protocol.ChatSession, error) {
body := struct {
Title string `json:"title"`