Skip to content

Provider files: headers and an ssh port from the reply, as format 3 - #248

Merged
Amitgb14 merged 2 commits into
masterfrom
conch/provider-headers
Nov 15, 2026
Merged

Amitgb14 merged 2 commits into
masterfrom
conch/provider-headers

Conversation

@Amitgb14

@Amitgb14 Amitgb14 commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Why

A provider file could send only the API key. Some APIs need more on a request: instabox refuses every create, start, stop and delete without an Idempotency-Key header (400 bad_request), and a delete without X-Confirm-Delete naming the machine (409 delete_confirmation_required). Its provider file passed check, then failed on the first create.

What

Format 3 adds headers:

format = 3
headers = { Idempotency-Key = "{uuid}" }   # every call

[delete]
call = "DELETE /sandboxes/{id}"
headers = { X-Confirm-Delete = "{id}" }    # this call, laid over the top ones by name
  • A value may use {uuid} (new for each request), {id} and {name} (known on create and [ssh.access]). A header whose placeholder has nothing to fill it is left out, not sent as its own letters; "" under a call leaves out a top-level one.
  • check refuses: headers without format = 3, invalid names, {key} or auth_header's own name (the key stays in one place), headers conch sets (Host, Content-Type, Content-Length, Accept, Transfer-Encoding, Connection), line breaks, unknown placeholders.
  • The review of a file (Describe) shows each call's headers.
  • A format-2 conch calls headers an unknown key and refuses the file, rather than sending requests the provider refuses.
  • providerfile.md (what the adapting agent is told) gains a Format 3 section; AGENTS.md mentions it.

Tests

  • format3_test.go: a fake instabox-shaped API that refuses a change without a fresh Idempotency-Key and a delete without X-Confirm-Delete, through create, stop, start, ssh access and delete; each header is checked on every request (a new v4 UUID each time, a call's header replacing the file's whatever its case, an empty one removing it, an unfilled one left out). With the headers not sent, it fails with the same 400 instabox gave.
  • Each problem check should report, and format 3 asked for from each place a header can go.
  • The format-2 tests that wrote the top format in now use ProviderFormat.

make gate passed. On the first run one internal/server shard failed; the rerun passed whole. That package does not touch provider files, but the flake is there.

Also: the ssh port from the access reply

A live create with the headers worked, then timed out on ssh: instabox's gateway is not on port 22, and its ssh-tokens reply says which port it is on. [ssh] port may now be "{reply.PATH}" (format 3), read from [ssh.access]'s reply as host and user are. A reply without a valid port is an error, not port 22. A number reads as before. Tested through the same fake (2222 from the reply, a port written as a string, and a missing, zero, out-of-range or non-numeric one), and check refuses a reply port with no [ssh.access].

make gate passed whole on this commit.

🤖 Generated with Claude Code

Amitgb14 and others added 2 commits November 15, 2026 14:43
A provider file could send only the key, so an API that needs more on a
request could not be described. instabox refuses every create, start,
stop and delete without an Idempotency-Key (400), and a delete without
X-Confirm-Delete naming the machine (409), so its file failed on the
first create.

Format 3 adds headers: a top-level table sent with every call, and one
under any call, laid over it by name ("" leaves one out). A value may
use {uuid}, new for each request, {id} and {name}; a header whose
placeholder has nothing to fill it is left out rather than sent as its
own letters. The key stays in auth_header alone: a header may not carry
{key} or reuse that name, nor set one conch sets (Host, Content-Type,
Accept, ...), nor hold a line break. A format-2 conch calls headers an
unknown key and refuses the file, rather than sending requests the
provider would refuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A gateway that hands out a credential per connection can name its port
the same way it names its host. instabox's ssh-tokens reply carries a
port, and its gateway does not listen on 22: with port = 22 the file
made a sandbox and then timed out reaching it.

[ssh] port may now be "{reply.PATH}" (format 3), read from the
[ssh.access] reply as host and user are. A reply with no port, or one
that is not a port, is said as an error rather than left to ssh's
default, which is the port such a gateway does not listen on. A number
reads as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Amitgb14 Amitgb14 changed the title Provider files: headers, as format 3 Provider files: headers and an ssh port from the reply, as format 3 Nov 15, 2026
@Amitgb14
Amitgb14 merged commit f0a6b21 into master Nov 15, 2026
4 checks passed
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