feat: document model alias logging and wire debugTokens through config#3782
Conversation
- Add apiProxy.logging.debugTokens and apiProxy.logging.tokenLogDir to the config schema, types, and env var wiring (AWF_DEBUG_TOKENS, AWF_TOKEN_LOG_DIR) - Document all model alias logging events (stdout and token-diag) in config spec §13 - Add comprehensive log file inventory (§13.4) listing all JSONL and text log files produced by Squid, API proxy, and CLI proxy - Rename token-diag.log → token-diag.jsonl (it writes JSONL records) - Rename cli-proxy access.log → access.jsonl (it writes JSON records) - Update Runtime JSONL Schemas table to include token-diag.jsonl, otel.jsonl, and cli-proxy access.jsonl Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR adds config-file support and documentation for API-proxy model-alias/token diagnostic logging, and standardizes structured log file extensions to .jsonl for consistency across components.
Changes:
- Add
apiProxy.logging.debugTokensandapiProxy.logging.tokenLogDirto the AWF config schema, config-file mapping, and runtime env injection for the api-proxy container. - Rename diagnostics/audit log filenames to
.jsonlwhere the content is JSONL (api-proxytoken-diag.*, cli-proxyaccess.*) and update the related test. - Expand
docs/awf-config-spec.mdwith a new “Model Alias Logging” section and an inventory of runtime log artifacts.
Show a summary per file
| File | Description |
|---|---|
src/types/api-proxy-options.ts |
Adds typed options for debugTokens / tokenLogDir with JSDoc. |
src/services/api-proxy-service.ts |
Wires debugTokens / tokenLogDir into api-proxy container environment variables. |
src/config-file.ts |
Extends config-file shape and maps apiProxy.logging.* into internal options. |
src/commands/build-config.ts |
Plumbs debugTokens / tokenLogDir into WrapperConfig assembly. |
src/awf-config-schema.json |
Adds apiProxy.logging object to the config schema. |
docs/awf-config.schema.json |
Mirrors schema changes for documentation consumption. |
docs/awf-config-spec.md |
Documents model-alias logging events, configuration, and log file inventory. |
containers/cli-proxy/server.js |
Renames structured access log output to access.jsonl. |
containers/api-proxy/token-persistence.js |
Renames diagnostic log output to token-diag.jsonl. |
containers/api-proxy/server.models.test.js |
Updates test expectations for the new token-diag.jsonl filename. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 5
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Update test assertions to match the current smoke-claude.md (max-turns changed from 2 to 10) and the current lock file (gh-aw-actions/setup at v0.74.4). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 96.53% | 96.58% | 📈 +0.05% |
| Statements | 96.37% | 96.42% | 📈 +0.05% |
| Functions | 97.99% | 97.99% | ➡️ +0.00% |
| Branches | 90.88% | 90.84% | 📉 -0.04% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/config-writer.ts |
89.3% → 90.9% (+1.65%) | 89.3% → 90.9% (+1.65%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test ResultsPR #3779: Increase smoke-claude max-turns from 2 to 10 ✅ GitHub MCP connectivity Status: PASS cc: @lpcox
|
📡 OTEL Tracing Smoke Test ResultsAll scenarios validated successfully: ✅ Module Loading — otel.js loaded, isEnabled=true, exports 11 functions Status: Infrastructure ready for OTEL tracing when endpoint is configured.
|
|
Smoke Codex: FAIL 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.
|
|
Smoke Test: 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.
|
Chroot Environment Version ComparisonThe chroot test compared runtime versions between the host and the chrooted environment:
Overall Result: ❌ Tests failed - version mismatches detected Python and Node.js versions differ between the host and chrooted environment, which may indicate the chroot is not properly inheriting the host system binaries or has separate installations.
|
Service Connectivity Test Results❌ Redis: Connection timeout (no response) Overall: FAILServices on
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS All build and test operations completed successfully across all 18 projects in 8 ecosystems.
|
Copilot BYOK Smoke Test Results✅ GitHub MCP - API connectivity verified Mode: BYOK offline ( Status: ✅ PASS @lpcox - All systems operational Note 🔒 Integrity filter blocked 1 itemThe following item was blocked because it doesn't meet the GitHub integrity level.
To allow these resources, lower tools:
github:
min-integrity: approved # merged | approved | unapproved | none
|
Summary
Adds first-class config support and documentation for model alias logging in the API proxy.
Config changes
apiProxy.logging.debugTokens(boolean): enables detailed token and model-alias diagnostic logging (AWF_DEBUG_TOKENS=1)apiProxy.logging.tokenLogDir(string): directory for token-usage.jsonl and token-diag.jsonl (AWF_TOKEN_LOG_DIR)Both are now wirable through the AWF config file (previously only available as raw env vars on the container).
File renames (JSONL extension consistency)
token-diag.log→token-diag.jsonl(writes JSONL records)access.log→access.jsonl(writes JSON records)Documentation (config spec §13)
Files changed
src/awf-config-schema.json+docs/awf-config.schema.json— schemasrc/types/api-proxy-options.ts— type definitionssrc/config-file.ts— config mappingsrc/commands/build-config.ts— build config wiringsrc/services/api-proxy-service.ts— env var injectioncontainers/api-proxy/token-persistence.js— .jsonl renamecontainers/api-proxy/server.models.test.js— test updatecontainers/cli-proxy/server.js— .jsonl renamedocs/awf-config-spec.md— documentation