Skip to content

fix(runnerhub): map RUNNER_ERROR_CODE_FAILED_PRECONDITION to Connect FailedPrecondition - #287

Open
seal-agent wants to merge 3 commits into
mainfrom
compass-server-1442-t2-error-map
Open

fix(runnerhub): map RUNNER_ERROR_CODE_FAILED_PRECONDITION to Connect FailedPrecondition#287
seal-agent wants to merge 3 commits into
mainfrom
compass-server-1442-t2-error-map

Conversation

@seal-agent

Copy link
Copy Markdown
Contributor

T2 of the SEA-1442 runner error-sentinels design (frozen record
docs/designs/platform/compass-runner-gateway-error-sentinels/design.md,
merged #284). The relay's runnerErrorToConnect maps a RunnerError to the
Connect status the client sees; the new FAILED_PRECONDITION code (added by
T1, PR #285) fell through to CodeInternal, so an operator-fault refusal
surfaced as an opaque 500. Map it to connect.CodeFailedPrecondition.

FailedPrecondition (not InvalidArgument) matches the repo's own
operator-fault vocabulary: errNotAgentAccount -> CodeFailedPrecondition in
comms/agent_caller.go, and comms/context.go maps store.ErrFailedPrecondition
-> CodeFailedPrecondition.

Red-green: the TestRunnerErrorToConnectCodeMapping row is RED first (the new
code degrades to default -> CodeInternal), GREEN after the case arm. Gate:
go test -race ./internal/runnerhub/... (full suite passes).

Stacked on T1 (compass-runner-1442-proto-enum) so the regenerated
FAILED_PRECONDITION constant is present and the test row is genuinely
red-green.

Spec-impact: none. Refs SEA-1442.

seal-agent and others added 2 commits August 12, 2026 12:03
…ault runner failures

The Runner has no wire code for "your deployment is misconfigured", so an operator-fault failure (canonically an agent socket path over the AF_UNIX limit, or socket-dir permissions/ownership) is relayed to the admin as Connect `Internal` — reading as a Compass bug rather than a knob to turn.

Adds one enum value to `RunnerErrorCode` (`proto/compass/v1/runner.proto`), tag 5, mirroring the `RESOURCE_EXHAUSTED` precedent (a new value with a doc comment naming its Connect mapping and the distinguishing rationale), and regenerates the internal Go tree. This is the shared prerequisite for the runner-side sentinel mapping (T3) and the server-side `runnerErrorToConnect` arm (T2, compass-server lane); an unmapped code still degrades to today's `CodeInternal`, so nothing breaks until those land.

The doc comment disambiguates DIRECTION: this code flows outbound Runner->Server->admin, distinct from the inbound Server->Runner `CodeFailedPrecondition` the Runner treats as a benign no-secrets / no-config-surface signal.

Wire change is additive and buf-breaking-safe (a new value in the internal-only `compass.v1` `RunnerService` package; no public TS client generates it). buf lint/breaking/drift/gen-fence green; generated code compiles.

Design: docs/designs/platform/compass-runner-gateway-error-sentinels/design.md (T1).

Spec-impact: none. Refs SEA-1442.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…eir package path

Review nit on #285: the inbound-direction disambiguation cited bare host.go / config_materialize.go, ambiguous in a multi-package tree. Qualify to go/internal/runner so a reader grepping lands in the right package. Comment-only; no wire/descriptor change (regenerated doc-comment copy tracks it).

Spec-impact: none. Refs SEA-1442.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

SEA-1442

@seal-agent seal-agent changed the title feat(proto): add RUNNER_ERROR_CODE_FAILED_PRECONDITION for operator-fault runner failures fix(runnerhub): map RUNNER_ERROR_CODE_FAILED_PRECONDITION to Connect FailedPrecondition Aug 12, 2026
@seal-agent
seal-agent changed the base branch from main to compass-runner-1442-proto-enum August 12, 2026 18:01
…FailedPrecondition

T2 of the SEA-1442 runner error-sentinels design (frozen record
docs/designs/platform/compass-runner-gateway-error-sentinels/design.md,
merged #284). The relay's runnerErrorToConnect maps a RunnerError to the
Connect status the client sees; the new FAILED_PRECONDITION code (added by
T1, PR #285) fell through to CodeInternal, so an operator-fault refusal
surfaced as an opaque 500. Map it to connect.CodeFailedPrecondition.

FailedPrecondition (not InvalidArgument) matches the repo's own
operator-fault vocabulary: errNotAgentAccount -> CodeFailedPrecondition in
comms/agent_caller.go, and comms/context.go maps store.ErrFailedPrecondition
-> CodeFailedPrecondition.

Red-green: the TestRunnerErrorToConnectCodeMapping row is RED first (the new
code degrades to default -> CodeInternal), GREEN after the case arm. Gate:
go test -race ./internal/runnerhub/... (full suite passes).

Stacked on T1 (compass-runner-1442-proto-enum) so the regenerated
FAILED_PRECONDITION constant is present and the test row is genuinely
red-green.

Spec-impact: none. Refs SEA-1442.
@seal-agent
seal-agent force-pushed the compass-server-1442-t2-error-map branch from b740f5d to 1b4c1ee Compare August 12, 2026 18:26
Base automatically changed from compass-runner-1442-proto-enum to main August 12, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant