Repository navigation
[log] Add debug logging to server session handling - #16678
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The change still has active moderate findings because session IDs can appear unredacted in failure logs on lines 94 and 100, violating the logging redaction contract.
1 open issue
What changed in this PR
Adds debug-level observability to server session handling without changing session behavior.
Changes:
- Logs fallback to the default session when no session ID is available.
- Logs session-directory stat and creation failures.
- Logs reuse of existing sessions through the existing session logger.
| File | Description |
|---|---|
| internal/server/session.go | Adds debug logging for default-session fallback, session-directory failures, and reuse of existing sessions. |
Review effort: Lite (adaptive)
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
@copilot fix all failing ci checks |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
Fixed the shared CI compile error in |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed in |
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write succeeded on any surface (zero leaks). Part B gap: the backend GitHub MCP server is launched with GITHUB_READ_ONLY=1 by gh-aw's tools.github wrapper, so write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are never registered — refusals are "tool not found", which proves backend config, not mcpg's own gateway-level DIFC enforcement. Part D/E could not be exercised because gh is unauthenticated in this environment, so the token-scope boundary was not independently confirmed this run. This is not a FAIL — all reads succeeded and nothing leaked — but gateway-level write enforcement on the MCP surface and REST/GraphQL token-scope enforcement remain unconfirmed by this probe. See internal/guard and internal/difc unit tests for independent evidence of mcpg's own write-blocking layer.
|

Adds four debug log calls to
internal/server/session.go, reusing the existinglogSessionlogger (server:session).SessionIDFromContext: logs when it falls back to thedefaultsession.ensureSessionDirectory: logs stat andMkdirAllfailures, including the directory path and error.requireSession: logs when an existing session is reused.No log argument computes anything or has side effects. Session IDs go through the existing
util.FormatSessionIDForLoghelper.Validation:
go vet ./internal/server,go test ./internal/serverandgo build -o awmgall pass. I did not run the fullmake agent-finished.