- Add guard assertion before non-null click on custom code switch
- Use await act(async ...) for timer advancement to avoid act warnings
- Pin locale in date range assertion for CI determinism
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds /key/info, /key/list, /key/aliases, and /team/daily/activity
to the hardcoded PERMISSION_OPTIONS in TeamSSOSettings.tsx.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LangSmith reads the Cost column from outputs.usage_metadata.total_cost,
but LangsmithLogger._prepare_log_data never wrote to that key. The
response_cost was already computed in StandardLoggingPayload but was
not forwarded to the outputs dict.
Inject usage_metadata with input_tokens, output_tokens, total_tokens,
and total_cost into the outputs dict so LangSmith can display cost.
Fixes#24001
Made-with: Cursor
Resolved conflicts in ScoreChart.test.tsx and HelpLink.test.tsx by
preferring origin/main's renderWithProviders pattern and merging
unique tests from both branches.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove Ant Design CSS class selector coupling in ExportFormatSelector test
- Lift mock fns out of TestTable component body to enable callback assertions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add explicit vi import to ScoreChart.test.tsx
- Use custom matcher for I/O modes to avoid cross-element text issues
- Use version-agnostic regex for Save button assertion
- Add comments noting placeholder data in GuardrailConfig tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add typeof string guards to all array element returns in resolveMode
to prevent non-string values from sneaking through via any-widening.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace unsafe `as string[]` cast in modeMatches with runtime type
check via `.some()`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move vi.useRealTimers() to afterEach for proper cleanup
- Use label-based DOM queries instead of fragile positional indexes
- Remove leftover debug console.log from AgentHubTableColumns.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add modeMatches() helper so array guardrail_mode values (e.g.
["pre_call", "post_call"]) place the entry in all matching timeline
buckets, not just the first. Updated test to verify both buckets.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The backend type for guardrail_mode is Optional[Union[str, List[str], Dict]]
but the UI typed it as just string, causing a crash when .replace() was
called on null/object/array values.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
list_team_v2 had 51 statements (limit 50). Extract the team-to-response-model
conversion loop into a helper function to satisfy ruff PLR0915.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document how to send Vertex Priority PayGo headers and explain how trafficType maps to service-tier pricing in LiteLLM, including an embedded flow diagram for quick understanding.
Made-with: Cursor
When scanning backward over counted messages, preserve old behavior for
adjacent assistant turns by inserting user_continue if the immediate
previous raw message is assistant. This handles malformed
assistant(tool_calls)->assistant(no-tool-calls) inputs without splitting
valid assistant(tool_calls)->tool chains.
Made-with: Cursor
- aresponses() now pops prompt_id from kwargs after the async hook runs
and passes merged_optional_params via _async_prompt_merged_params.
responses() checks for this internal kwarg first and skips the sync
hook entirely when present — eliminating double-merge of template
messages.
- merged_optional_params from async_get_chat_completion_prompt is no
longer discarded (_); it flows through to local_vars in responses().
- Async tests now assert get_chat_completion_prompt.assert_not_called()
to directly detect any double-execution regression.
Made-with: Cursor
- Populate container_id on streaming code_interpreter_results by
re-emitting at message_delta when container info arrives
- Reconstruct Pydantic OutputCodeInterpreterCall objects from plain
dicts in _extract_tool_result_output_items so responses_output
has uniform types across streaming and non-streaming paths
- test_non_bash_tool_result_skipped: verifies text_editor results produce
zero code_interpreter_call items
- test_end_to_end_streaming_chunks_to_code_interpreter_output: exercises
full path from Anthropic SSE chunks through ModelResponseIterator,
stream_chunk_builder, and _extract_tool_result_output_items without
a live server
Skip non-bash tool result types (e.g. text_editor_code_execution_tool_result)
to avoid producing empty code_interpreter_call items in Responses API output.
Replace str(content) fallback with empty string so non-dict content
(e.g. list-shaped text_editor results) produces outputs=None instead
of raw Python object representations in logs.
- Empty stdout/stderr now produces outputs=None (matching OpenAI parity)
instead of outputs=[{logs:""}], in both streaming and non-streaming paths
- Fix test fixture to use real Anthropic type "bash_code_execution_tool_result"
instead of "code_execution_tool_result"
- Add test for empty-output → outputs=None behavior
- Add unit tests for _extract_tool_result_output_items: Pydantic objects,
plain dicts (post-model_dump), empty/missing provider_specific_fields,
and in-place substitution preserving output ordering
When both stdout and stderr are empty strings, the `if parts else
str(content)` fallback produced the raw dict representation as logs.
Drop the fallback so logs is correctly empty.
stream_chunk_builder uses "last value wins" for list-valued
provider_specific_fields keys. _build_code_interpreter_results was
emitting only new items (incremental), so earlier results were silently
dropped when multiple sequential code executions occurred.
- Emit cumulative list from _build_code_interpreter_results, matching
web_search_results pattern
- Assemble server_tool_use input from input_json_delta deltas at
content_block_stop (Anthropic streams input: {} in start block)
- Handle dict items in _extract_tool_result_output_items after
model_dump() serialization in stream_chunk_builder
- Simplify _merge_provider_specific_fields to last-value-wins for lists,
matching stream_chunk_builder semantics
PR #18945 added support for capturing Anthropic server-side tool results
(bash_code_execution_tool_result, etc.) in provider_specific_fields, but
the data never reached the Responses API output because:
1. Non-streaming: provider_specific_fields wasn't copied into _hidden_params
2. Streaming: chunk delta's provider_specific_fields wasn't accumulated
3. Tool results weren't mapped to standard output items
This fix:
- Copies provider_specific_fields to _hidden_params in transform_response()
- Accumulates provider_specific_fields from streaming chunk deltas
- Maps bash_code_execution_tool_result to code_interpreter_call output items
with code and outputs (matching OpenAI's native shape)
- Removes redundant function_call items for server-side tools
- Adds OutputCodeInterpreterCall type to the output union
Restore backward-compatible behavior: only insert assistant_continue
between directly adjacent user messages, not across tool-call chains.
The _counts_for_alternation skip logic was a silent behavioral change
for [user, assistant(tc), tool, user] sequences.
Made-with: Cursor
- Fix async path: call async_get_chat_completion_prompt in aresponses()
before executor dispatch, mirroring acompletion() in main.py. Discard
merged_optional_params in async path (sync responses() handles them
via local_vars), avoiding TypeError from duplicate kwargs in partial().
- Fix provider re-resolution: replace "/" in model heuristic with
model != original_model comparison so bare model names are handled.
- Add 3 async tests covering hook invocation, optional param
propagation, and non-message item filtering in aresponses().
Made-with: Cursor
- Restore backward compat for leading assistant(tool_calls) — always prepend user_continue
- Replace partial assertions with full list assertion in trailing tool-call test
Made-with: Cursor