Repository navigation
refactor(agent): remove the 35 unused AgentService RPCs - #56
Merged
Merged
Conversation
The local agent's Connect AgentService (packages/proto/proto/agent.proto) had 48 RPCs, but live code calls only 13 of them: GetProject, GetApps, GetVariables, GetUsers, GetSecrets, Exec, GetInstalledPackages, GetProcesses, GetNixConfig, GetShellStatus, RebuildShell, GetModuleOutputs and PatchNixData. The other 35 duplicated REST endpoints, had no callers, and had drifted from their REST versions. For example, the Connect ReadFile, WriteFile and ListFiles handlers accepted absolute paths and skipped the project-root containment that /api/files enforces. Removed end to end: - agent.proto: the 35 rpc entries, the 46 messages only they used, and the config/aws/sst imports they needed. This includes GetSstRequest, which existed only so the extra GetSst method that protoc-gen-connect-handlers emitted for GetSSTConfig would compile. - Go agent: their handlers in connect_service.go and connect_handlers.go, all of connect_modules.go (including moduleToProto and its enum mappers, which already had no caller), and the isProcessRunning and writeNixEntityJSON helpers that only those handlers used. REST handlers are unchanged. - Studio: the use-agent.ts hooks that called the removed RPCs, their query keys and proto type re-exports, the forceRefresh/isRefreshing fields of the useNixConfig wrapper (its only use of RefreshNixConfig; no component read them), and the demo MSW cases and fixtures that mocked the removed methods. REST-backed hooks are unchanged. - Docs: the agent README and code comments that described the removed RPCs or pointed at the removed hooks. packages/proto/gen and connect_entities_gen.go were regenerated with `packages/proto/generate.sh buf`, then formatted with `nix fmt`, which keeps the committed Go output clean for the flake's treefmt check. JSON schemas for the removed messages were deleted. Regenerating also: - bumps the protoc-gen-go header in every .pb.go from v1.36.11 to v1.36.12, because buf.gen.yaml does not pin that remote plugin; - drops one blank line from agent.connect.go's imports under the current formatter; - reorders connect_entities_gen.go, because protoc-gen-connect-handlers iterates a Go map. Refs: stackpanel-thq.8.2
cooper (czxtm)
had a problem deploying
to
docs-preview
September 23, 2026 12:54 — with
GitHub Actions
Failure
Contributor
|
Preview |
Contributor
|
Docs preview |
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The local agent's Connect
AgentServicehad 48 RPCs, but live code calls only 13 of them. The other 35 duplicated REST endpoints, had no callers, and had drifted from their REST versions. This PR removes them end to end:agent.protouse-agent.tshooks and their demo mocksThat includes the Connect
ReadFile/WriteFile/ListFileshandlers, which skipped the project-root containment that/api/filesenforces. REST handlers and REST-backed hooks are unchanged. In total: 416 files, +794/-21,440. The hand-written part is 11 files, -2,688.Verification by the implementer, against an origin/main baseline in the same worktree:
go buildandgo vetpass.go testfails only the same 5 tests as the baseline.tsgoonapps/webreports 104 errors before and 100 after, with no new ones.agent-clienttypechecks. Web vitest passes 49 of 50; the one failure is the known R2 cache test.vp lintreports 0 errors.Notes on the generated code:
nix fmtto match the committed formatting.connect_entities_gen.gois reordered, because the custom plugin iterates a Go map.Refs stackpanel-thq.8.2, ADR 0004