docs: sync schemas and specs with source changes#5283
Conversation
- schemas/token-usage.schema.json: add 5 optional budget fields written by mergeBudgetFields (effective_tokens_this_response, effective_tokens_total, model_multiplier, ai_credits_this_response, ai_credits_total). These fields are part of the wire format when apiProxy.maxEffectiveTokens or apiProxy.maxAiCredits is configured, confirmed by token-tracker.schema.test.js. - docs/awf-config-spec.md §5: add missing apiProxy.maxCacheMisses → --max-cache-misses mapping row. Triggered by commit 6de3216 (fix(api-proxy): 403 for terminal caps; fix Anthropic/Copilot input credits). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR updates documentation artifacts (a JSON schema and a config spec doc) to better match the current AWF api-proxy implementation, specifically around token-usage record fields and CLI-to-config mappings.
Changes:
- Extend
schemas/token-usage.schema.jsonto document five optional budget-tracking fields emitted into token-usage JSONL records. - Add the missing
apiProxy.maxCacheMisses→--max-cache-misses <number>row to the normative CLI mapping table indocs/awf-config-spec.md.
Show a summary per file
| File | Description |
|---|---|
| schemas/token-usage.schema.json | Documents additional optional budget-tracking fields emitted in token-usage JSONL records. |
| docs/awf-config-spec.md | Adds missing CLI mapping row for apiProxy.maxCacheMisses. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
|
✅ Copilot review passed with no inline comments. @github-actions[bot] Add the |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot merge main |
…-06-19-f44e522d16eacfb9
Merged |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Build Test Suite completed successfully! |
|
✅ Contribution Check completed successfully! |
|
🚀 Security Guard has started processing this pull request |
|
❌ Smoke Claude failed |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
Smoke Test: Copilot BYOK (Direct Mode) ✅Running in direct BYOK mode via api-proxy sidecar → api.githubcopilot.com Test Results:
Status: PASS CC:
|
🔬 Smoke Test ResultsPR: docs: sync schemas and specs with source changes
Overall: FAIL — Pre-computed step outputs were not injected (template variables unresolved). MCP connectivity confirmed working.
|
🔬 Smoke Test: PAT Auth — PASS
Overall: PASS · Auth mode: PAT (COPILOT_GITHUB_TOKEN) PR: docs: sync schemas and specs with source changes · Author:
|
Smoke Test Results
Overall status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
|
✅ "chore: upgrade gh-aw to v0.80.6 and recompile workflows" Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Version Comparison Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
🔭 Smoke Test: API Proxy OpenTelemetry Tracing
All scenarios pass. ✅
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Overall: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — FAIL
Overall: FAIL
|
PRs #5279 and #5283 both added `apiProxy.maxCacheMisses` to Section 5 of the spec within 20 seconds of each other, creating a duplicate entry in the CLI mapping table. Removes the redundant second entry (after maxPermissionDenied), keeping the correct placement between maxModelMultiplierCap and maxPermissionDenied that PR #5283 added. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…5387) PRs #5279 and #5283 both added `apiProxy.maxCacheMisses` to Section 5 of the spec within 20 seconds of each other, creating a duplicate entry in the CLI mapping table. Removes the redundant second entry (after maxPermissionDenied), keeping the correct placement between maxModelMultiplierCap and maxPermissionDenied that PR #5283 added. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
What changed
Two schema/spec files were out of sync with the implementation, found during analysis of commit 6de3216 (fix(api-proxy): 403 for terminal caps; fix Anthropic/Copilot input credits).
schemas/token-usage.schema.json— add 5 optional budget fieldsmergeBudgetFields()incontainers/api-proxy/token-tracker-shared.jsconditionally writes five fields onto every token-usage JSONL record when budget tracking is active (apiProxy.maxEffectiveTokensorapiProxy.maxAiCredits):ai_credits_this_responseapiProxy.maxAiCreditsconfiguredai_credits_totalapiProxy.maxAiCreditsconfiguredeffective_tokens_this_responseapiProxy.maxEffectiveTokensconfiguredeffective_tokens_totalapiProxy.maxEffectiveTokensconfiguredmodel_multiplierapiProxy.maxEffectiveTokensconfiguredThese are verified by
token-tracker.schema.test.js(lines 300–407) but were absent from the schema, so consumers reading the schema for documentation were unaware of them. The schema already usesadditionalProperties: trueso records are not rejected at runtime, but the documentation was incomplete.docs/awf-config-spec.md §5— add missing CLI mapping rowapiProxy.maxCacheMisses→--max-cache-misses <number>was missing from the §5 CLI-to-config mapping table. The config field (config-file.tsline 30), the schema entry (awf-config.schema.jsonline 147), and the CLI option (cli-options.tsline 357) all exist — only the spec table row was absent. Added betweenmaxPermissionDeniedandrequestedModelin the sorted order.What was NOT changed
$idURLs were not bumped (release-time only per spec).copilotTargetbasePathdiscrepancy was left as-is: the schema intentionally documentsbasePathas unsupported for Copilot targets.apiProxy.authOIDC block gap (config-file.tshas onlyanthropicTokenUrl, schema has 17 OIDC fields) was not touched — the schema is ahead ofconfig-file.tsand no regression occurred.audit.schema.jsonwas not changed:userAgent,protocol,clientPort,destPortarefirewall_detailedaccess-log fields only, notaudit_jsonlfields; they do not appear in theaudit.jsonlwire format.