Skip to content

Commit 1a11e91

Browse files
committed
Stabilize patch apply status enum values
1 parent 7a40208 commit 1a11e91

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ If no new rule is detected -> do not update the file.
208208
- Read `AGENTS.md` and relevant docs before editing code.
209209
- Keep API behavior aligned with actual Gemini CLI contracts first; TypeScript SDK mapping may be used only as an optional historical reference, not as a blocker for C# SDK design.
210210
- For `ManagedCode.GeminiSharpSDK`, do not import Codex-specific behavior, docs, or assumptions into implementation or tests unless the user explicitly asks for cross-SDK comparison; keep Gemini fixes grounded in real Gemini CLI behavior.
211+
- Do not involve Copilot-specific workflows, assignments, or assumptions in this repository unless the user explicitly asks for them; handle review and fix work directly in the repo.
211212
- Maintain GitHub workflow health (`.github/workflows`).
212213

213214
**Ask first:**

GeminiSharpSDK.Tests/Unit/ThreadEventParserTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ public async Task Parse_ParsesFileChangeItemStartedWithInProgressStatus()
7878
await Assert.That(fileChange.Changes[0].Kind).IsEqualTo(PatchChangeKind.Add);
7979
}
8080

81+
[Test]
82+
public async Task PatchApplyStatus_PublicNumericValues_RemainStable()
83+
{
84+
var completed = (int)PatchApplyStatus.Completed;
85+
var failed = (int)PatchApplyStatus.Failed;
86+
var inProgress = (int)PatchApplyStatus.InProgress;
87+
88+
await Assert.That(completed).IsEqualTo(0);
89+
await Assert.That(failed).IsEqualTo(1);
90+
await Assert.That(inProgress).IsEqualTo(2);
91+
}
92+
8193
[Test]
8294
public async Task Parse_ThrowsForUnsupportedEventType()
8395
{

GeminiSharpSDK/Models/Items.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public enum PatchChangeKind
2525

2626
public enum PatchApplyStatus
2727
{
28-
InProgress,
29-
Completed,
30-
Failed,
28+
Completed = 0,
29+
Failed = 1,
30+
InProgress = 2,
3131
}
3232

3333
public enum McpToolCallStatus

0 commit comments

Comments
 (0)