{"record":{"id":"eeb96d63266da3ce","repo":"gastownhall/beads","slug":"proxied-server-provider-t-does-not-offer-the-issu","errorCode":null,"errorMessage":"proxied-server provider %T does not offer the issue-count surface","messagePattern":"proxied-server provider %T does not offer the issue-count surface","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/count_proxied_server.go","lineNumber":21,"sourceCode":"import (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/steveyegge/beads/internal/storage/uow\"\n\t\"github.com/steveyegge/beads/issueops\"\n)\n\n// proxiedCounter hands back the guarded issue-count surface for the\n// proxied-server provider, through the provider's OWN capability accessor —\n// the same two-step proxiedCommenter performs, and for the same reason: the\n// accessor is where each layer is added.\nfunc proxiedCounter() (issueops.Counter, error) {\n\tif uowProvider == nil {\n\t\treturn nil, errors.New(\"proxied-server UOW provider not initialized\")\n\t}\n\tsrc, ok := uowProvider.(uow.CounterSource)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"proxied-server provider %T does not offer the issue-count surface\", uowProvider)\n\t}\n\treturn src.Counter()\n}\n","sourceCodeStart":3,"sourceCodeEnd":25,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/count_proxied_server.go#L3-L25","documentation":"The proxied-server path resolves an issue Counter through the global uowProvider's capability accessor. The provider must implement the uow.CounterSource interface; if the concrete provider type wired in at startup doesn't offer that surface, proxiedCounter refuses with this type-mismatch message naming the offending concrete type (%T). It's a wiring/capability bug, not a runtime data problem.","triggerScenarios":"A command routes counting through the proxied-server provider while uowProvider holds a concrete type that does not implement uow.CounterSource — e.g. a provider build that only registers the comment surface (proxiedCommenter) or a partially initialized proxy stack; also reachable via openCounter whenever the current route selects the proxied server.","commonSituations":"Running against a proxied server whose client bundle predates the issue-count capability; embedding or stubbing a custom provider in tests/tools without implementing Counter(); version skew between the bd binary and the proxy provider wiring.","solutions":["Upgrade bd / the provider wiring so the proxied-server provider implements uow.CounterSource (the %T in the message names the missing concrete type)","Bypass the proxy: point bd at the database directly so openCounter picks the non-proxied counter","If you supply a custom provider, add the Counter() accessor required by uow.CounterSource","Check for mixed-version installs (old binary with new server or vice versa) and align versions"],"exampleFix":"// before\ntype myProvider struct{} // lacks Counter()\n// after\nfunc (p *myProvider) Counter() (issueops.Counter, error) { return p.src.Counter() } // implement uow.CounterSource","handlingStrategy":"type-guard","validationCode":"// Before relying on the proxied counter, assert the capability\nif _, ok := uowProvider.(uow.CounterSource); !ok {\n    // fall back to direct-DB counting or fail fast with a clear message\n}","typeGuard":"func hasCounter(p any) bool {\n    _, ok := p.(uow.CounterSource)\n    return ok\n}","tryCatchPattern":"counter, err := openCounter(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"does not offer the issue-count surface\") {\n        // upgrade provider / bypass proxy\n    }\n    return err\n}","preventionTips":["Keep bd binary and proxy server versions aligned","Any custom uow provider must implement all capability interfaces including uow.CounterSource","After wiring a provider, smoke-test each routed command (count, comment) at startup","Check the %T in the error message to identify exactly which concrete type lacks the surface"],"tags":["provider","capability","proxy","type-assertion"],"backgroundTag":"provider-capability-missing","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}