Repository navigation
feat(agent): resolve the project per request and add v1 ShellService - #62
Merged
Merged
Conversation
Project-scoped v1 services now run behind a project interceptor, inside authentication. It resolves the X-Stackpanel-Project header (the one the Studio already sends and CORS already allows) to a registered project, falling back to the agent's current project and then the registry default. It attaches that project's runtime from the runtime registry, so v1 and the legacy handlers share the same instances. ShellService is the first project-scoped service: GetShellStatus with typed timestamps, and RebuildShell streaming a started/output/completed oneof. A failed rebuild ends the stream with a Connect error instead of an in-band error event, and an overlapping rebuild returns FailedPrecondition. ADRs 0004 and 0005 now match what shipped: GetAgentInfo is exempt from auth, requests are capped before decoding, the header is X-Stackpanel-Project, and header-less requests use the current project before the default. Refs: stackpanel-thq.8.1.1
cooper (czxtm)
had a problem deploying
to
docs-preview
September 23, 2026 14:32 — with
GitHub Actions
Failure
Contributor
|
Preview |
Contributor
|
Docs preview |
This branch was successfully 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.
Project-scoped v1 services now run behind a project interceptor, inside authentication. The interceptor resolves the
X-Stackpanel-Projectheader to a registered project. Without the header, it falls back to the agent's current project, then to the registry default. It attaches that project's runtime from the runtime registry, so v1 and the legacy handlers share the same instances.ShellServiceis the first project-scoped service:GetShellStatusRebuildShellas a server stream of started, output and completed events. A failed rebuild ends the stream with a Connect error, and an overlapping rebuild returns FailedPrecondition.ADRs 0004 and 0005 are corrected to match what shipped:
GetAgentInfois public, requests are capped before decoding, the header is namedX-Stackpanel-Project, and header-less requests fall back in the order above.The old
GetShellStatus/RebuildShellRPCs stay until the web migrates in a follow-up PR.Verification:
go build,go vetandgofmt, all clean.-race. The 6 new ones cover:go build ./...andgo vet ./internal/agent/...pass.go test ./internal/agent/...fails onlyTestSetupAcknowledgementRequiresAuthAndProjectEvidence, which already fails on main.buf generateplusnix fmt, andconnect_entities_gen.gois unchanged.Refs stackpanel-thq.8.1.1, ADR 0005