Repository navigation
Conversation
…7.1 circularity
Under TypeScript 7.1, defineHarness() and host.open() fail with TS2615
("Type of property 'agents' circularly references itself in mapped type
'Pick<SessionImpl<…>, PublicSessionMember>'"). HarnessAgentsOf matched the
whole HarnessDefinition, whose session reaches AgentHandles, which remaps
keys through HarnessAgentsOf again. Read agents and subagents.agents alone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f1266ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Agent extraction and type validation packages/ai-harness/src/define.ts, packages/ai-harness/tests/types.test-d.ts, .changeset/harness-agents-of-ts71.md |
HarnessAgentsOf infers agent types from agents and subagents.agents. Type assertions cover both properties, absent agents, and AnyHarness. The changeset describes the TypeScript 7.1 TS2615 report and the type-resolution change. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: alemtuzlak
Merge Risk: 
Minimal · up to f1266
-
No actionable issue remains in the reviewed change. It is ready to merge after normal checks.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: HarnessAgentsOf now infers from properties to fix a TS 7.1 circularity. It uses the fix(ai-harness) scope and matches the raw summary and PR objectives. It is specific and descriptive, so it passes.
Full details: Description check
-
Explanation
The description covers the change and the reason for it. It names the TS2615 error, the cause in HarnessAgentsOf, the fix, and the new type test. The checklist is filled in. The template's first '## 🎯 Changes' heading is followed by the author's content, and the template placeholder comment and a duplicate '## 🎯 Changes' heading remain. The author did not fill in the 'Release Impact' section beyond ticking the changeset box, which is consistent with the changeset file. The description is mostly complete, so it passes. Minor cleanup is suggested.
Resolution
Remove the duplicate '## 🎯 Changes' heading and the leftover template comment in the description. Optionally state the docs decision in the checklist, since no docs change is listed.
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
View your CI Pipeline Execution ↗ for commit f1266ad
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-cloudflare
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-compaction
@tanstack/ai-computer-local
@tanstack/ai-computer-playwright
@tanstack/ai-computer-sandbox
@tanstack/ai-computer-use
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-harness
@tanstack/ai-harness-cli
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-e2b
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-llmgateway
@tanstack/ai-lovable
@tanstack/ai-mcp
@tanstack/ai-memory
@tanstack/ai-mistral
@tanstack/ai-neon
@tanstack/ai-octane
@tanstack/ai-ollama
@tanstack/ai-ollaya
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-reactor
@tanstack/ai-remix
@tanstack/ai-sandbox
@tanstack/ai-sandbox-blaxel
@tanstack/ai-sandbox-boxd
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-e2b
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-railway
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-upstash-box
@tanstack/ai-sandbox-vercel
@tanstack/ai-skills
@tanstack/ai-solid
@tanstack/ai-svelte
@tanstack/ai-typesafe
@tanstack/ai-utils
@tanstack/ai-vercel-gateway
@tanstack/ai-vertex
@tanstack/ai-vue
@tanstack/ai-worldlabs
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
@tanstack/svelte-ai-devtools
commit: |
|
This comment is automated by a Grok agent. It is not a maintainer review. Verdict: ready Findings
Push Security Maintainers still GitHub-approve. |
🎯 Changes
Under TypeScript 7.1,
defineHarness()andhost.open()fail with:TypeScript 7.0 accepts the same code.
Cause:
HarnessAgentsOfinfers the agents by matching the wholeHarnessDefinition. That definition holdssession: SessionWithMetadata<…>, whoseagents: AgentHandles<THarness>remaps keys throughHarnessAgentsOfagain. TS 7.1 reports the loop.Fix:
HarnessAgentsOfnow infers from theagentsandsubagents.agentsproperties only. The result type is unchanged. A type test checks it for a harness with agents and subagents, with only agents, with neither, and forAnyHarness.🎯 Changes
✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Summary by CodeRabbit