Background
engine.custom.transport: http is fully declared in the schema (internal/config/schema.go CustomHTTPConfig) and rejected at runtime with a clear "not yet implemented" error (internal/agent/custom.go::Run). The local-transport implementation, however, is currently a pile of runLocal / buildLocalExec / finishLocal / readRawResult private methods on CustomAgent, with assumptions baked in (output file on disk, stdout fallback, artifact paths in workspace).
When HTTP lands, those assumptions don't translate:
- Result format negotiation: HTTP body vs file read.
- Artifact handling: HTTP file downloads with retry vs local filesystem reads.
- Streaming responses.
- Retry / circuit-breaker policies.
Proposal
Introduce an internal transport interface inside the agent package:
type customTransport interface {
Run(ctx context.Context, opts ExecOptions, vars map[string]string, sess *SessionInput) (rawResult string, execErr error, artifactSources []artifactSource)
}
Move the existing runLocal body behind a localTransport struct that satisfies this. CustomAgent.Run dispatches to the right transport without further branching.
Outcome: HTTP gains a parallel httpTransport that drops in without rewriting finishLocal.
Why this is a follow-up, not a blocker
Doing it now would be premature — we don't yet know HTTP's real shape. Doing it just before HTTP implementation begins is the sweet spot.
Origin
Raised during the self code-review of feat/custom-engine-local (architecture finding #3).
Background
engine.custom.transport: httpis fully declared in the schema (internal/config/schema.goCustomHTTPConfig) and rejected at runtime with a clear "not yet implemented" error (internal/agent/custom.go::Run). The local-transport implementation, however, is currently a pile ofrunLocal/buildLocalExec/finishLocal/readRawResultprivate methods onCustomAgent, with assumptions baked in (output file on disk, stdout fallback, artifact paths in workspace).When HTTP lands, those assumptions don't translate:
Proposal
Introduce an internal
transportinterface inside the agent package:Move the existing
runLocalbody behind alocalTransportstruct that satisfies this.CustomAgent.Rundispatches to the right transport without further branching.Outcome: HTTP gains a parallel
httpTransportthat drops in without rewritingfinishLocal.Why this is a follow-up, not a blocker
Doing it now would be premature — we don't yet know HTTP's real shape. Doing it just before HTTP implementation begins is the sweet spot.
Origin
Raised during the self code-review of
feat/custom-engine-local(architecture finding #3).