Skip to content

fix(types): make context builder output attachable - #77

Open
LukasParke wants to merge 3 commits into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-context-input
Open

fix(types): make context builder output attachable#77
LukasParke wants to merge 3 commits into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-context-input

Conversation

@LukasParke

Copy link
Copy Markdown
Collaborator

What

  • add structural ContextInput (readonly ContextLayer[] or any object with readonly layers)
  • accept it at spawn and withContext type/runtime seams
  • make context([...]) output directly assignable without losing its inferred shape
  • update example helper seams, specs, docs, and agent-builder references

Why

ContextConfig preserves exact layer types and is therefore invariant. The output of the public context() builder was not assignable to the context option on the builders it is meant to feed. A shallow structural input type preserves inference while giving attachment seams the minimum shape they need.

This semantically ports fork/port/openrouter-fixes commit efc2b689 onto post-#68 withContext/current names without restoring deleted bundled patterns.

Test plan

  • compile/runtime ContextInput tests — 13 pass
  • types/context/core typechecks
  • examples typecheck
  • root lint
  • export-tag check
  • sentrux check .
  • clean-context Pi review; fixed docs, delegate helper seam, and object-branch runtime coverage

Compatibility

Additive type widening only. Existing arrays and ContextConfig values remain valid.

Port ContextInput from fork/port/openrouter-fixes commit efc2b68 onto current withContext/spawn names and post-68 example surfaces.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@LukasParke is attempting to deploy a commit to the Matt Apperson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@LukasParke

Copy link
Copy Markdown
Collaborator Author

Agent: CI reached the full core suite and failed only the unrelated timing-sensitive executeRunCode retry backoff test (fixed backoff or linear backoff depending on the run). The affected package tests/typechecks and local full suite passed. The separate compat failure is the repository workflow receiving an empty OPENROUTER_API_KEY, and Vercel requires upstream authorization. I cannot rerun upstream Actions without repository admin rights.

Run executeRunCode tests serially so their temporary global setTimeout proxy cannot capture delays from sibling tests under CI concurrency.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
Expose the pure retry-delay calculation for deterministic assertions instead of proxying global setTimeout, which captured sibling test timers under CI concurrency.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
@LukasParke

Copy link
Copy Markdown
Collaborator Author

Agent: Root-caused the repeated core CI failure to retry tests proxying global setTimeout and capturing sibling-test timers. Pushed a deterministic fix that tests the pure retry-delay function without mutating globals. DCO and Structural gate pass; CI rerun is in progress.

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