Skip to content

test: align Claude adapter thread identity assertions - #243

Closed
dl-alexandre wants to merge 1 commit into
pingdotgg:codething/648ca884-claudefrom
dl-alexandre:codething/648ca884-claude
Closed

dl-alexandre wants to merge 1 commit into
pingdotgg:codething/648ca884-claudefrom
dl-alexandre:codething/648ca884-claude

Conversation

@dl-alexandre

@dl-alexandre dl-alexandre commented Mar 7, 2026 •

Copy link
Copy Markdown

Fixes the failing CI assertions in ClaudeCodeAdapter.test.ts for PR #179.

Updates stale expectations to match current adapter behavior:

  • Session/turn IDs remain on the orchestrator thread ID
  • thread.started carries providerThreadId in payload
  • native observability records assert providerThreadId instead of threadId
  • resume cursor threadId reflects the active orchestrator thread ID

Validated locally:

  • bun run test src/provider/Layers/ClaudeCodeAdapter.test.ts
  • bun lint
  • bun typecheck

Note

Align Claude adapter tests to assert external thread IDs and provider-native identifiers in ClaudeCodeAdapter.test.ts

Updates tests to assert session.threadId and turn.threadId as external IDs via String(...), expect thread.started to include payload.providerThreadId, and switch native observability checks from event.event.threadId to event.event.providerThreadId in ClaudeCodeAdapter.test.ts.

📍Where to Start

Start with the test cases in ClaudeCodeAdapter.test.ts, focusing on expectations for session.threadId, turn.threadId, thread.started payloads, and observability event assertions.

Macroscope summarized 47ddb15.

@vercel

vercel Bot commented Mar 7, 2026

Copy link
Copy Markdown

@dl-alexandre is attempting to deploy a commit to the Ping Labs Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c41b44e-548b-4f6b-b267-441e0274935f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@t3dotgg t3dotgg added the junk for bad prs label Mar 7, 2026
@t3dotgg t3dotgg closed this Mar 7, 2026
aiva-code Bot pushed a commit to moltenmouse/t3code that referenced this pull request Nov 13, 2026
…work ended

Sol's review of AIV-574 (P15, aiva-core pingdotgg#243):

- A turn waiting on an approval when its account was renewed carried on in
  the same Claude process once approved, so its next model call met the
  revoked token (seen with the real CLI). Now, when a stale-token process
  has a model call refused (api_retry 401), the adapter asks a small
  worker (aiva/tokenHandover.ts, one layer in server.ts) to restart the
  turn in place, once per attempt: the approved tool has run by then and
  Claude Code waits on the refusal (CLAUDE_CODE_OAUTH_401_WAIT_MS), so
  the new attempt goes on with the new token. This also covers any other
  way a stale process reaches Claude mid-turn.
- Reopening a stale-token process ends the background work it runs (the
  CLI's shells and subagents die with it). The turn it reopens for is now
  told what was cancelled, as t3's restart note does (same entries, its
  own reason), so the agent knows to restart it.

Tests: ClaudeAdapterV2 (a refused current token asks for nothing, a
refused old token for one restart; the reopened turn's prompt names its
background shell); live in aiva-core hub/tests/claude_renewal_test.py.
For aiva.14, to be rebuilt from this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

junk for bad prs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants