Fix Codex token reporting and validate Windows runtime - #61
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Codex token usage parsing, adds Windows validation, updates .NET dependencies, and documents cross-platform launch behavior.
Changes:
- Parses wrapped absolute
tokenUsage.totalsnapshots without double-countinglast. - Adds parser and Windows subprocess regression coverage.
- Expands CI to Linux and Windows and updates documentation and dependencies.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Summary | Review note |
|---|---|---|
tests/Symphony.Integration.Tests/Symphony.Integration.Tests.csproj |
Updates test dependencies. | — |
tests/Symphony.Integration.Tests/CodexAgentRunnerTests.cs |
Adds token usage and Windows regression coverage. | — |
src/Symphony.Infrastructure.Workspaces/Symphony.Infrastructure.Workspaces.csproj |
Updates .NET dependencies. | — |
src/Symphony.Infrastructure.Workflows/Symphony.Infrastructure.Workflows.csproj |
Updates .NET dependencies. | — |
src/Symphony.Infrastructure.Tracker.GitHub/Symphony.Infrastructure.Tracker.GitHub.csproj |
Updates .NET dependencies. | — |
src/Symphony.Infrastructure.Persistence.Sqlite/Symphony.Infrastructure.Persistence.Sqlite.csproj |
Updates EF Core and security dependencies. | — |
src/Symphony.Infrastructure.Agent.Codex/Symphony.Infrastructure.Agent.Codex.csproj |
Updates Codex dependencies. | — |
src/Symphony.Infrastructure.Agent.Codex/CodexAgentRunner.cs |
Parses wrapped absolute token totals. | — |
src/Symphony.Host/Symphony.Host.csproj |
Updates host dependencies. | — |
SPEC.md |
Documents platform-specific shell contracts. | — |
README.md |
Documents cross-platform CI. | — |
IMPLEMENTATION_PLAN.md |
Records cross-platform validation. | — |
.github/workflows/ci.yml |
Adds Windows CI coverage. | Critical: update the token usage assertion from other_message to thread/tokenUsage/updated before requiring Windows CI. |
Suppressed comments (1)
SPEC.md:454
- This updates the launch contract in sections 5.3.6 and 10.1, but section 17.5 still says the client invokes
bash -lcon every platform (SPEC.md:2041). That leaves the normative conformance checklist contradictory for Windows; update that checklist to use the same platform-specific invocation.
- The runtime launches this command through the platform shell in the workspace directory:
- Windows: `cmd.exe /d /s /c <codex.command>`
- macOS/Linux: `/bin/bash -lc <codex.command>`
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec mapping
SPEC.mdsection 10.1: platform-specific Codex subprocess launch contract.SPEC.mdsections 10.4 and 13.5: streamed usage telemetry and absolute token accounting.SPEC.mdsection 13.7.1: dashboard/runtime token-consumption observability.SPEC.mdsection 17: agent protocol and Windows execution conformance coverage.Summary
thread/tokenUsage/updatedpayload shape atparams.tokenUsage.total.totalsnapshot and ignore the per-responselastsnapshot so persisted and dashboard totals do not double-count.ubuntu-latestandwindows-latest.cmd.exe /d /s /cand macOS/Linux/bin/bash -lclaunch contract in the spec and implementation plan.Root cause
The app-server now reports thread totals inside a wrapper:
{ "method": "thread/tokenUsage/updated", "params": { "tokenUsage": { "total": { "inputTokens": 110, "outputTokens": 70, "totalTokens": 180 }, "last": { "inputTokens": 11, "outputTokens": 7, "totalTokens": 18 } } } }Symphony found
tokenUsagebut expected token fields directly on that object. Parsing therefore returned no usage values, leaving persisted and API/dashboard totals at zero. The parser now unwraps the absolutetotalobject before extracting counters.Validation
dotnet restore Symphony.slnx: passed with no warnings.dotnet build Symphony.slnx --configuration Release --no-restore: passed with 0 warnings and 0 errors.dotnet test Symphony.slnx --configuration Release --no-build --no-restore: 136 passed, 0 failed; the single real-GitHub integration test remained intentionally opt-in and skipped.dotnet format Symphony.slnx --verify-no-changes --no-restore: passed.dotnet list Symphony.slnx package --vulnerable --include-transitive: no vulnerable packages across all projects.dotnet restore src/Symphony.Host/Symphony.Host.csproj --runtime win-x64: passed.win-x64publish: passed;Symphony.exe versionreturnedSymphony 0.1.0-dev, andsetup-symphony.cmdpluswwwroot/index.htmlwere present.git diff --check: passed.Risk and rollout
lastsnapshot is not accumulated.References