Skip to content

chore: test fixes - #4803

Closed
TejasGhatte wants to merge 1 commit into
graphite-base/4803from
06-30-chore_test_fixes
Closed

chore: test fixes#4803
TejasGhatte wants to merge 1 commit into
graphite-base/4803from
06-30-chore_test_fixes

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Exports the acquireAnthropicResponsesStreamState and releaseAnthropicResponsesStreamState functions by renaming them to AcquireAnthropicResponsesStreamState and ReleaseAnthropicResponsesStreamState, making them accessible from test files and external packages.

Changes

  • Renamed acquireAnthropicResponsesStreamStateAcquireAnthropicResponsesStreamState and releaseAnthropicResponsesStreamStateReleaseAnthropicResponsesStreamState to export these functions, allowing test code to reference them directly without relying on unexported identifiers.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go test ./core/providers/anthropic/...

All existing tests for TestCodeExecution_BashStream, TestCodeExecution_TextEditorStream, and TestCodeExecution_ProgrammaticStreamRoundTrip should continue to pass without modification.

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

None. This change only affects the visibility of internal pool management functions used in tests.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2eebae1e-1cfa-4dae-835d-b7d3569e3f22

📥 Commits

Reviewing files that changed from the base of the PR and between eb381d7 and 9ac2c54.

📒 Files selected for processing (1)
  • core/providers/anthropic/codeexecution_test.go

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Updated streaming-related test coverage to align with the latest stream-state handling, helping keep Anthropic response streaming behavior reliable.

Walkthrough

Three streaming tests in codeexecution_test.go are updated to call AcquireAnthropicResponsesStreamState and ReleaseAnthropicResponsesStreamState (exported/capitalized) instead of the previous unexported lowercase variants. No logic or assertions changed.

Anthropic Stream State Helper Rename

Layer / File(s) Summary
Stream state helper rename in three tests
core/providers/anthropic/codeexecution_test.go
TestCodeExecution_BashStream, TestCodeExecution_TextEditorStream, and TestCodeExecution_ProgrammaticStreamRoundTrip updated to use exported AcquireAnthropicResponsesStreamState/ReleaseAnthropicResponsesStreamState instead of the previous lowercase helpers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • danpiths
  • akshaydeo

Poem

🐇 A capital letter, a small rename done,
Acquire and Release now shine in the sun.
Three tests aligned, the helpers now bold,
Exported and proper, a tale to be told.
Hop hop, the rabbit approves this run! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change only renames test helpers and does not implement Files API support or POST /v1/files required by #123. Implement the Files API workflow for the Anthropic/OpenAI provider, including file upload endpoints and related RAG/fine-tuning support.
Out of Scope Changes check ⚠️ Warning The helper rename is unrelated to the linked Files API support work, so the PR includes unrelated scope. Remove the unrelated test-helper export changes or replace them with Files API implementation work aligned to #123.
Title check ❓ Inconclusive The title is generic and only loosely indicates test-related changes, without describing the exported helper rename. Use a specific title like “Export Anthropic stream state helpers for tests” so the main change is clear.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description includes all required sections and is mostly complete, with only minor checklist incompleteness.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-30-chore_test_fixes

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TejasGhatte
TejasGhatte marked this pull request as ready for review June 30, 2026 12:39
@TejasGhatte TejasGhatte mentioned this pull request Jun 30, 2026
18 tasks

TejasGhatte commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a pure rename of three call sites to match the now-exported pool helpers; no logic is altered.

Only a test file is touched, renaming unexported pool-helper calls to their newly exported counterparts in responses.go. The pool acquire/release pattern and defer placement are unchanged, so there is no risk of state leaks or behavior regressions.

No files require special attention.

Important Files Changed

Filename Overview
core/providers/anthropic/codeexecution_test.go Updates three test call sites to use the exported function names AcquireAnthropicResponsesStreamState / ReleaseAnthropicResponsesStreamState after those functions were promoted to exported in responses.go on the base branch; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Test: TestCodeExecution_BashStream\nTestCodeExecution_TextEditorStream\nTestCodeExecution_ProgrammaticStreamRoundTrip"] --> B["AcquireAnthropicResponsesStreamState()\n(was: acquireAnthropicResponsesStreamState)"]
    B --> C["anthropicResponsesStreamStatePool.Get()"]
    C --> D["*AnthropicResponsesStreamState\n(maps initialized/cleared)"]
    D --> E["test body runs"]
    E --> F["defer ReleaseAnthropicResponsesStreamState(state)\n(was: releaseAnthropicResponsesStreamState)"]
    F --> G["anthropicResponsesStreamStatePool.Put(state)"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["Test: TestCodeExecution_BashStream\nTestCodeExecution_TextEditorStream\nTestCodeExecution_ProgrammaticStreamRoundTrip"] --> B["AcquireAnthropicResponsesStreamState()\n(was: acquireAnthropicResponsesStreamState)"]
    B --> C["anthropicResponsesStreamStatePool.Get()"]
    C --> D["*AnthropicResponsesStreamState\n(maps initialized/cleared)"]
    D --> E["test body runs"]
    E --> F["defer ReleaseAnthropicResponsesStreamState(state)\n(was: releaseAnthropicResponsesStreamState)"]
    F --> G["anthropicResponsesStreamStatePool.Put(state)"]
Loading

Reviews (1): Last reviewed commit: "chore: test fixes" | Re-trigger Greptile

@TejasGhatte
TejasGhatte changed the base branch from 06-30-fix_custom_provider_key_form_bedrock to graphite-base/4803 July 1, 2026 08:04
@TejasGhatte TejasGhatte closed this Jul 1, 2026
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.

2 participants