feat: show a model, agent and duration footer after each turn
Match the first-party chat footer on touch screens: after a turn ends, its last assistant message gets a row with the model name (resolved from /api/model with the id as fallback), the agent and how long the turn took, plus a "more" menu. The menu shows the completion timestamp and offers copy answer and fork from here; forking copies history before the next prompt (or the whole history at the end) and opens the new session. Bump version to 0.1.7 (build 8).
This commit is contained in:
1 parent
56cf889ee9
commit
8268bdecc2
6 files changed
+308
-8
No files matched your search
@@ -26,6 +26,21 @@ func (c *Client) Prompt(ctx context.Context, sessionID string, o PromptOptions)
|
||||
return c.do(ctx, http.MethodPost, path, requestOptions{directory: o.Directory}, body, nil)
|
||||
}
|
||||
|
||||
// ForkSession copies the session's history before a message into a new
|
||||
// session. An empty before copies the whole history.
|
||||
func (c *Client) ForkSession(ctx context.Context, sessionID, directory, before string) (Session, error) {
|
||||
body := map[string]any{}
|
||||
if before != "" {
|
||||
body["before"] = before
|
||||
}
|
||||
var payload struct {
|
||||
Data Session `json:"data"`
|
||||
}
|
||||
path := "/api/session/" + url.PathEscape(sessionID) + "/fork"
|
||||
err := c.do(ctx, http.MethodPost, path, requestOptions{directory: directory}, body, &payload)
|
||||
return payload.Data, err
|
||||
}
|
||||
|
||||
// Interrupt stops the turn the session is running.
|
||||
func (c *Client) Interrupt(ctx context.Context, sessionID, directory string) (bool, error) {
|
||||
var payload struct {
|
||||
|
||||
Reference in new issue
Block a user