Skip to content

t18: fix CodeRabbit review feedback from PR #6 - #20

Merged
superdav42 merged 1 commit into
mainfrom
feature/t18-fix-review-followup
Apr 13, 2026
Merged

superdav42 merged 1 commit into
mainfrom
feature/t18-fix-review-followup

Conversation

@superdav42

Copy link
Copy Markdown
Contributor

Summary

Addresses the three actionable suggestions from CodeRabbit's review of PR #6 that were merged unresolved (tracked in issue #18).

Changes

  • readme.txt:39 — provider id reference updated from anthropic-max to ultimate-ai-connector-anthropic-max; docs now match the renamed provider registered since v1.1.0.
  • readme.txt:56 — same fix in the FAQ entry ("Can I use this alongside the standard Anthropic provider?").
  • js/connector.jsx:660 — CONFIG object now wrapped with Object.freeze() so the shared reference passed to all five deferred registerConnector() calls is immutable and cannot be accidentally mutated between ticks.

Verification

grep 'ultimate-ai-connector-anthropic-max' readme.txt   # should match lines 39 and 56
grep 'Object.freeze' js/connector.jsx                   # should match CONFIG declaration

No behaviour change. No version bump needed (documentation and defensive coding only).

Resolves #18

- readme.txt: update provider id references from 'anthropic-max' to
  'ultimate-ai-connector-anthropic-max' (lines 39, 56) — docs now match
  the renamed provider registered since v1.1.0
- js/connector.jsx: freeze CONFIG with Object.freeze() so the shared
  object passed to all deferred registerConnector() calls is immutable

Closes #18
@superdav42 superdav42 added the origin:interactive Created by interactive user session label Apr 13, 2026
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 53 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 53 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d0d26bd-f719-42e8-b81e-43d33f07aa18

📥 Commits

Reviewing files that changed from the base of the PR and between 48cd613 and 86b6745.

📒 Files selected for processing (2)
  • js/connector.jsx
  • readme.txt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/t18-fix-review-followup

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.

@superdav42
superdav42 merged commit 207951a into main Apr 13, 2026
1 check passed
@superdav42
superdav42 deleted the feature/t18-fix-review-followup branch April 13, 2026 04:44
@superdav42

Copy link
Copy Markdown
Contributor Author

MERGE_SUMMARY

What was done: Fixed three CodeRabbit review suggestions from PR #6 that were merged unresolved (issue #18).

  1. readme.txt:39 — updated provider id from anthropic-max to ultimate-ai-connector-anthropic-max in the description paragraph.
  2. readme.txt:56 — same fix in the FAQ answer for coexistence with the standard Anthropic provider.
  3. js/connector.jsx:660 — wrapped the CONFIG object with Object.freeze() to prevent accidental mutation across the five deferred registerConnector() calls.

Testing: Changes are documentation and defensive coding only; no runtime behaviour changed. Verified the updated strings are correct via grep against the merged commit.

Issue closed: Resolves #18

superdav42 added a commit that referenced this pull request May 18, 2026
… tool-use (#29)

* fix(anthropic): round-trip thinking signature for extended-thinking + tool-use

Anthropic's Messages API rejects multi-turn requests that echo back a prior
'thinking' content block without the original 'signature' field — required
for extended thinking when interleaved with tool_use. Previously:

- Inbound parser dropped the signature, constructing the thought-channel
  MessagePart with only (text, channel). The signature was lost.
- Outbound serializer emitted {type:'thinking', thinking:<text>} with no
  signature field, so the second turn of any extended-thinking + tool-use
  exchange got a 400 from Anthropic.

Capture the signature on inbound when the SDK exposes thought signatures
(php-ai-client >= 1.3.0, gated via method_exists), and replay it on outbound
when the MessagePart carries one. Pre-1.3 SDKs behave exactly as before.

Mirrors WordPress/ai-provider-for-anthropic PR #20 in scope but uses
method_exists gating to match this plugin's existing Codex model
(src/Models/ChatGptCodexTextGenerationModel.php) style.

Note: redacted_thinking blocks are still dropped on inbound — a separate
follow-up.

* fix(anthropic): round-trip redacted_thinking blocks

Extends the prior commit to handle Anthropic's redacted_thinking content
blocks, which are emitted when the safety system redacts the model's
chain of thought. Previously they were silently dropped on inbound,
breaking any conversation containing them as soon as it was replayed
across the second turn.

Pack the encrypted 'data' field into a JSON-shaped thought signature
({"type":"redacted_thinking","data":"<...>"}) on an empty-text
thought-channel MessagePart, mirroring the JSON-blob signature pattern
already used by this plugin's ChatGptCodexTextGenerationModel for
OpenAI Responses-API reasoning items.

On outbound, peek the signature: if it JSON-decodes to a redacted
shape, emit a redacted_thinking block; otherwise emit a thinking block
with the raw signature (existing behaviour preserved).

Pre-1.3 SDKs lack the thought-signature slot entirely; in that case
redacted_thinking remains a silent drop (no regression).

Verified via reflection-based round-trip in a live WP runtime:
  - thinking + signature: byte-for-byte round-trip
  - redacted_thinking:    byte-for-byte round-trip
  - thinking (no sig):    byte-for-byte round-trip (legacy path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:interactive Created by interactive user session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review followup: PR #6 — v1.1.0: rename provider id to ultimate-ai-connector-anthropic-max + fix render clobber

1 participant