High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: the sessions-disabled remedy prescribes a config set the editor rejects as an unknown field, which is the dead end this family's codes exist to remove (PIN-150)
Luigi Agosti846f3c85aa3c
diff --git a/internal/server/sessions_unavailable.go b/internal/server/sessions_unavailable.goindex 68b16d45..87a3346a 100644--- a/internal/server/sessions_unavailable.go+++ b/internal/server/sessions_unavailable.go@@ -25,8 +25,12 @@ const (msgSessionsUnavailableInBridgeMode = "agent sessions are unavailable in bridge mode"remedySessionsUnavailableInBridge = "run the full server instead: pinchtab server"- msgSessionsDisabled = "agent sessions are not enabled on this server"- remedySessionsDisabled = "pinchtab config set sessions.agent.enabled true && pinchtab server restart"+ msgSessionsDisabled = "agent sessions are not enabled on this server"+ // The config editor knows sessions.dashboard.* and no sessions.agent.* field, so+ // "pinchtab config set sessions.agent.enabled true" answers "unknown field" — the same+ // dead end this family's remedy existed to remove, one state over. The file edit works,+ // and it is what the shared CLI hint already tells a reader.+ remedySessionsDisabled = "set sessions.agent.enabled = true in config.json, then restart the server")// registerSessionsUnavailable answers the whole session family with one coded refusal.diff --git a/internal/server/sessions_unavailable_test.go b/internal/server/sessions_unavailable_test.goindex 2bbdd024..ad49cbb9 100644--- a/internal/server/sessions_unavailable_test.go+++ b/internal/server/sessions_unavailable_test.go@@ -7,6 +7,7 @@ import ("strings""testing"+ "github.com/pinchtab/pinchtab/internal/config""github.com/pinchtab/pinchtab/internal/session")@@ -102,6 +103,32 @@ func TestTheTwoUnavailableModesDoNotShareARemedy(t *testing.T) {if strings.Contains(bridgeRemedy, "sessions.agent.enabled") {t.Errorf("the bridge remedy prescribes a config edit, which is the unescapable loop this fixes: %q", bridgeRemedy)}++ for mode, remedy := range map[string]string{"bridge": bridgeRemedy, "disabled": disabledRemedy} {+ if field, prescribed := configSetFieldIn(remedy); prescribed {+ if err := config.SetConfigValue(&config.FileConfig{}, field, "true"); err != nil {+ t.Errorf("the %s remedy says to run `pinchtab config set %s`, and the config editor answers %v — a remedy that cannot run is the dead end this family's codes exist to remove", mode, field, err)+ }+ }+ }+}++// configSetFieldIn reports the field a remedy tells the reader to `pinchtab config set`.+// A remedy naming a key the editor does not know sends the reader round the same loop as+// the bare 404 did, and only the editor can say which keys those are — this family's own+// disabled remedy shipped as `config set sessions.agent.enabled`, which answers "unknown+// field" because the editor knows sessions.dashboard.* and no sessions.agent.* field.+func configSetFieldIn(remedy string) (string, bool) {+ const prefix = "config set "+ at := strings.Index(remedy, prefix)+ if at < 0 {+ return "", false+ }+ field := strings.Fields(remedy[at+len(prefix):])+ if len(field) == 0 {+ return "", false+ }+ return field[0], true}// An unknown path must stay a bare 404 saying nothing about sessions — in both modes. This