Symptom
The api CI job intermittently fails with three tests in Foundry.UnitTests.Modules.Credentials.Features.Login.LoginSuccessCommitterTests.CommitAsync failing together:
WhenAccountExists_PublishesCredentialsValidated
WhenAccountExists_SetsOAuthModeAndIdentity
WhenManualDispatchPauseExists_DoesNotClearManualPause
All three fail the same way:
System.Text.Json.JsonException : The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
at Foundry.Modules.Credentials.Infrastructure.Configurations.ClaudeAccountConfiguration.DeserializeAuthMode(String json) in src/Modules/Credentials/Foundry.Modules.Credentials/Infrastructure/Configurations/ClaudeAccountConfiguration.cs:line 105
at lambda_method(Closure, QueryContext, DbDataReader, ResultContext, SingleQueryResultCoordinator)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
The value converter is reading an empty string back out of the auth_mode column, so the row was either written with an empty value or read before the write landed.
Evidence
Observed on 2026-08-19 while merging the dependency PRs:
It reproduces on main with no dependency change involved, so it is not caused by the EF Core 10.0.11 bump (#436). It has not reproduced locally on Windows (2941/2941 passing).
Ruled out
- Cross-test database sharing — the test class opens its own
Data Source=:memory: SqliteConnection per instance and calls EnsureCreatedAsync in InitializeAsync, so each test class has a private database.
Worth investigating
- Whether
AuthModeJsonConverter.Write can produce an empty payload for some AuthMode variant (a converter that writes nothing leaves '' in the column rather than failing at write time).
- Whether the static
JsonSerializerOptions instances in ClaudeAccountConfiguration are being used from parallel test collections in a way that yields an empty write.
Because the failure is intermittent, a fix should come with a test that pins the round-trip for every AuthMode variant rather than relying on the CI job going green once.
Symptom
The
apiCI job intermittently fails with three tests inFoundry.UnitTests.Modules.Credentials.Features.Login.LoginSuccessCommitterTests.CommitAsyncfailing together:WhenAccountExists_PublishesCredentialsValidatedWhenAccountExists_SetsOAuthModeAndIdentityWhenManualDispatchPauseExists_DoesNotClearManualPauseAll three fail the same way:
The value converter is reading an empty string back out of the
auth_modecolumn, so the row was either written with an empty value or read before the write landed.Evidence
Observed on 2026-08-19 while merging the dependency PRs:
main(7de0174) — failed, 3 failed / 2938 passed.maincommit (9214081) — passed, same tests, no code change in this area.It reproduces on
mainwith no dependency change involved, so it is not caused by the EF Core 10.0.11 bump (#436). It has not reproduced locally on Windows (2941/2941 passing).Ruled out
Data Source=:memory:SqliteConnectionper instance and callsEnsureCreatedAsyncinInitializeAsync, so each test class has a private database.Worth investigating
AuthModeJsonConverter.Writecan produce an empty payload for someAuthModevariant (a converter that writes nothing leaves''in the column rather than failing at write time).JsonSerializerOptionsinstances inClaudeAccountConfigurationare being used from parallel test collections in a way that yields an empty write.Because the failure is intermittent, a fix should come with a test that pins the round-trip for every
AuthModevariant rather than relying on the CI job going green once.