Skip to content

chore(csharp): bump version to 0.1.49 and fix User-Agent#126

Open
sawradip wants to merge 1 commit into
mainfrom
fix/csharp-version-bump
Open

chore(csharp): bump version to 0.1.49 and fix User-Agent#126
sawradip wants to merge 1 commit into
mainfrom
fix/csharp-version-bump

Conversation

@sawradip
Copy link
Copy Markdown
Contributor

@sawradip sawradip commented May 1, 2026

Summary

  • Bump package version from 0.1.48 to 0.1.49 in RunAgent.csproj to align with all other SDKs
  • Fix User-Agent header from 0.1.47 to 0.1.49 in RestClient.cs (was 2 versions behind)

Test plan

  • Verify RunAgent.csproj shows version 0.1.49
  • Verify outgoing HTTP requests have User-Agent: RunAgent-CSharp/0.1.49
  • Run dotnet build to confirm no regressions

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Bumped package version to 0.1.49

- Bump package version from 0.1.48 to 0.1.49 in RunAgent.csproj
- Fix User-Agent header from 0.1.47 to 0.1.49 in RestClient.cs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 55453369-210b-42d7-89a1-1f49e9e8b239

📥 Commits

Reviewing files that changed from the base of the PR and between 2c0de38 and 4b18ec6.

📒 Files selected for processing (2)
  • runagent-csharp/RunAgent.csproj
  • runagent-csharp/src/Client/RestClient.cs

📝 Walkthrough

Walkthrough

The pull request updates package version metadata across the project from 0.1.48 to 0.1.49, including the NuGet project file and the HTTP client's User-Agent header to maintain version consistency.

Changes

Cohort / File(s) Summary
Version Metadata Updates
runagent-csharp/RunAgent.csproj, runagent-csharp/src/Client/RestClient.cs
Bumps project version from 0.1.48 to 0.1.49 in project file and updates User-Agent header version in RestClient to match.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A whisker-twitch, a version bump so neat,
From point-one-forty-eight, now forty-nine's complete,
The headers hop, the metadata does dance,
Consistency blooms in this small advance!
squeak 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: bumping the C# package version to 0.1.49 and updating the User-Agent header, which aligns with the actual changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/csharp-version-bump

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@sawradip
Copy link
Copy Markdown
Contributor Author

sawradip commented May 2, 2026

Review: C# SDK version bump (#126)

This PR is straightforward — a version bump from 0.1.480.1.49 in RunAgent.csproj and fixing the User-Agent string that was two versions behind (0.1.470.1.49). Both changes are correct.

However, reviewing this alongside the sibling PRs (#122 Dart, #123 Go, #124 TS, #125 Python) reveals three issues in the existing C# SDK code that this PR does not address.


Bug 1: persistent_memory = false is never sent (REST + WebSocket)

In RestClient.cs and SocketClient.cs, the payload inclusion guard is:

if (persistentMemory)
{
    payload["persistent_memory"] = persistentMemory;
}

This is a truthy check — false is silently dropped from the payload. The same bug existed in the TS PR (#124) and was fixed with if (persistentMemory !== undefined). The C# fix should be:

if (persistentMemory)
{
    payload["persistent_memory"] = true;
}

Wait — the real issue is whether the server needs an explicit false or just omission. But the sibling SDKs (Go, TS) explicitly send false when the user sets it. More importantly, since persistentMemory is a non-nullable bool that defaults to false, there is currently no way for a caller to distinguish "not set" from "set to false". A user calling WithPersistentMemory(false) expects the field to be sent. The correct fix is to either:

  • Always include persistent_memory unconditionally (simplest, consistent with the field always having a value), or
  • Change the parameter to bool? (nullable) so omission vs. explicit false can be distinguished

Go PR #123 uses omitempty to omit the zero value; the C# SDK should at minimum document the chosen behaviour. As written, WithPersistentMemory(false) is a no-op since false is never sent.

Bug 2: RUNAGENT_USER_ID and RUNAGENT_PERSISTENT_MEMORY env vars are not read

ConfigLoader.FromEnvironment() and the constructor only resolve RUNAGENT_API_KEY and RUNAGENT_BASE_URL. The UserId and PersistentMemory fields on RunAgentClientConfig are never populated from environment variables.

Every other SDK in this batch added env var support:

Constants.cs does not define EnvUserId or EnvPersistentMemory constants, and ConfigLoader has no logic to read them. CreateFromEnvironmentAsync is therefore incomplete — it ignores these two fields.

Bug 3: Getter naming inconsistency

The C# getter for persistent memory is named IsPersistentMemoryEnabled() while all sibling SDKs use GetPersistentMemory() / getPersistentMemory(). The Is prefix is idiomatic C# for boolean predicates, so this isn't wrong in isolation, but it breaks cross-SDK consistency for users working across languages. Consider whether to standardise on GetPersistentMemory() to match the pattern.


What is correct in the existing C# SDK

  • UserId/PersistentMemory fields exist on RunAgentClientConfig with correct types (string? / bool), JSON property names, XML docs, and fluent builder methods (WithUserId, WithPersistentMemory).
  • Both RunAgent and RunStream overloads pass userId and persistentMemory through to RestClient/SocketClient.
  • GetUserId() returns string? — correctly nullable.
  • PascalCase properties, nullable reference types (<Nullable>enable</Nullable>), and XML doc comments are all applied consistently.
  • The ApiResponse<T>.Success field being bool (non-nullable) is fine; false is the correct default.
  • The User-Agent fix in this PR is correct.

Summary

The two-line version bump in this PR is correct. But before merging, the existing SDK has:

  1. persistent_memory = false silently dropped from REST and WebSocket payloads (both RestClient.cs and SocketClient.cs).
  2. RUNAGENT_USER_ID and RUNAGENT_PERSISTENT_MEMORY env vars unimplemented (Constants.cs, ConfigLoader.cs).

These should either be addressed in this PR or tracked as follow-up issues to match the feature parity established by the other SDK PRs.

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.

1 participant