all: s/title/slug/, adjust branch handling
There are two intertwined changes here.
First, replace title with slug, and precommit with commit-message-style.
The slug makes enough of a title, and it provides a single human-readable
identifier we can use everywhere.
Second, construct the branch name on the fly instead of storing it,
out of slug, branch prefix, and retryNumber.
This removes some duplicated data, and makes the retry loop
easier to follow and reason about.
diff --git a/loop/server/loophttp.go b/loop/server/loophttp.go
index 94d1037..5a657f8 100644
--- a/loop/server/loophttp.go
+++ b/loop/server/loophttp.go
@@ -74,7 +74,7 @@
MessageCount int `json:"message_count"`
TotalUsage *conversation.CumulativeUsage `json:"total_usage,omitempty"`
InitialCommit string `json:"initial_commit"`
- Title string `json:"title"`
+ Slug string `json:"slug,omitempty"`
BranchName string `json:"branch_name,omitempty"`
BranchPrefix string `json:"branch_prefix,omitempty"`
Hostname string `json:"hostname"` // deprecated
@@ -1266,7 +1266,7 @@
WorkingDir: getWorkingDir(),
// TODO: Rename this field to sketch-base?
InitialCommit: s.agent.SketchGitBase(),
- Title: s.agent.Title(),
+ Slug: s.agent.Slug(),
BranchName: s.agent.BranchName(),
BranchPrefix: s.agent.BranchPrefix(),
OS: s.agent.OS(),