Skip to content

fix(http): resolve the turn catalogue inside the authority lease - #130

Open
omkarjainak wants to merge 3 commits into
systemind-team:mainfrom
omkarjainak:fix/125-http-execute-turn-authority-outage
Open

omkarjainak wants to merge 3 commits into
systemind-team:mainfrom
omkarjainak:fix/125-http-execute-turn-authority-outage

Conversation

@omkarjainak

@omkarjainak omkarjainak commented Nov 26, 2026 •

Copy link
Copy Markdown

Summary

Fixes #125. POST /v1/turns no longer pre-lists tools outside the turn's authority lease, so a transient authority outage cannot run the turn with an empty tool list and report succeeded.

Changes

  • ExecutionRequest.tools is now optional. Omitting it means "use the whole catalogue resolved inside the lease"; an explicit list still narrows it, and an explicit empty list still means no tools.
  • RuntimeTurnRequest.tools remains required at runtime.
  • SharedOSExecutor normalizes an omitted catalogue to an array before the rest of the turn, while remembering that it was unspecified, so the executor takes the whole catalogue the lease resolves instead of treating it as "no tools".
  • createKernelSharedOSApi.executeTurn no longer calls kernel.listTools before the turn, removing the redundant authority load and its audit event.
  • Updated conformance assembly, HTTP test expectation, and docs/http-api.md.

Rationale

The pre-turn lookup ran without a lease and failed closed by returning []. The executor then intersected that empty set with its in-lease catalogue, yielding zero tools while the turn still succeeded. Resolving the catalogue inside the lease makes the outage fail closed consistently.

Testing

  • pnpm check
  • pnpm pack:check
  • pnpm typecheck
  • pnpm vitest run packages/http/src/http.test.ts packages/runtime/src/runtime.test.ts (50 tests)
  • Permission-denied paths are covered
  • Protocol compatibility is documented

Security

  • New capabilities deny by default
  • Tool discovery and invocation enforce the same grant
  • No credentials, private context, or evaluator data cross boundaries

Compatibility

  • Breaking contract change is documented in an ADR
  • No breaking contract change

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.

If authority can't be loaded just before a turn starts, POST /v1/turns runs the turn with no tools and still reports "succeeded"

1 participant