feat(webui): surface allow_concurrent/max_retries/review_enabled on the repositories card
RepoView.ReviewEnabled was previously absent from GET /api/config entirely, not just unrendered; add it alongside AllowConcurrent and MaxRetries. The repositories table gains Concurrent/Max retries/ Self-review columns as read-only pills -- this is the concrete discoverability fix for "why isn't a second agent running": that config was already reachable from the API, just never shown. config.example.toml documents review_enabled, which had no example entry before this. Full inline editing of per-repo fields is out of scope here: the dashboard's PATCH /api/config path has no array-index support for updating one element of the Repos slice, which is separate, real scope -- filed as archie-core-b6ew.6. Closes archie-core-b6ew.4
This commit is contained in:
1 parent
35eb4050de
commit
302caedec9
5 files changed
+62
-4
No files matched your search
@@ -258,6 +258,7 @@ type RepoView struct {
|
||||
PersistentStorage bool `json:"persistent_storage"`
|
||||
AllowConcurrent bool `json:"allow_concurrent"`
|
||||
MaxRetries int `json:"max_retries"`
|
||||
ReviewEnabled bool `json:"review_enabled"`
|
||||
}
|
||||
|
||||
// ProviderView is an LLM provider's shape, never its key. APIKeyEnv is the
|
||||
@@ -475,6 +476,7 @@ func reposView(repos []config.Repo) []RepoView {
|
||||
PersistentStorage: r.PersistentStorage,
|
||||
AllowConcurrent: r.AllowConcurrent,
|
||||
MaxRetries: r.MaxRetries,
|
||||
ReviewEnabled: r.ReviewEnabled,
|
||||
})
|
||||
}
|
||||
return out
|
||||
|
||||
@@ -256,6 +256,40 @@ func TestHandleConfigReportsLockedKeys(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestHandleConfigRepoViewIncludesReviewEnabled proves Repo.ReviewEnabled
|
||||
// reaches the dashboard alongside AllowConcurrent and MaxRetries --
|
||||
// previously it was absent from RepoView entirely, not merely unrendered
|
||||
// (archie-core-b6ew.4).
|
||||
func TestHandleConfigRepoViewIncludesReviewEnabled(t *testing.T) {
|
||||
srv := newTestServer(t)
|
||||
srv.Cfg = config.NewHolder(config.Config{
|
||||
Repos: []config.Repo{
|
||||
{Owner: "acme", Name: "widget", Base: "main", AllowConcurrent: true, MaxRetries: 3, ReviewEnabled: true},
|
||||
{Owner: "acme", Name: "gadget", Base: "main"},
|
||||
},
|
||||
})
|
||||
|
||||
req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/api/config", nil)
|
||||
w := httptest.NewRecorder()
|
||||
srv.Handler().ServeHTTP(w, req)
|
||||
|
||||
var got ConfigView
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &got); err != nil {
|
||||
t.Fatalf("decode: %v", err)
|
||||
}
|
||||
if len(got.Repositories) != 2 {
|
||||
t.Fatalf("Repositories = %+v, want 2", got.Repositories)
|
||||
}
|
||||
widget := got.Repositories[0]
|
||||
if !widget.AllowConcurrent || widget.MaxRetries != 3 || !widget.ReviewEnabled {
|
||||
t.Errorf("widget = %+v, want AllowConcurrent=true MaxRetries=3 ReviewEnabled=true", widget)
|
||||
}
|
||||
gadget := got.Repositories[1]
|
||||
if gadget.AllowConcurrent || gadget.MaxRetries != 0 || gadget.ReviewEnabled {
|
||||
t.Errorf("gadget = %+v, want all repo-tuning fields at their zero value", gadget)
|
||||
}
|
||||
}
|
||||
|
||||
// TestHandleConfigIncludesSchemaWithLiveValues proves the schema (archie-core-b6ew.2)
|
||||
// carries the same values as the flat ConfigView fields it is built from,
|
||||
// not a stale or empty catalog.
|
||||
|
||||
Reference in new issue
Block a user