Skip to content

Conversation

@bokelley
Copy link
Contributor

Problem: Multiple PRs added debugging with print and console.print but none of it appears in Fly logs. Cannot diagnose why Test Agent MCP is failing.

Solution: Replace invisible debugging with logger.error calls that show up in production logs.

Added debugging with magnifying glass emoji at key points in get_principal_from_context showing context type, get_http_headers results, fallback paths, and final outcome.

Testing: All tests pass. Fixed test compatibility with Mock objects. logger.error output will be visible in Fly logs.

Problem:
- print() to stderr doesn't appear in Fly logs
- console.print() doesn't appear in Fly logs
- Cannot diagnose why MCP tenant detection is failing

Solution:
- Add logger.error() calls with 🔍 emoji at key points in get_principal_from_context()
- Shows:
  - Whether context is passed and what type
  - What attributes context has (meta, headers, etc.)
  - What get_http_headers() returns
  - Which fallback path is taken
  - Final outcome

This will finally give us visibility into what's happening.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 649ae3a into main Oct 24, 2025
3 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
Problem:
- print() to stderr doesn't appear in Fly logs
- console.print() doesn't appear in Fly logs
- Cannot diagnose why MCP tenant detection is failing

Solution:
- Add logger.error() calls with 🔍 emoji at key points in get_principal_from_context()
- Shows:
  - Whether context is passed and what type
  - What attributes context has (meta, headers, etc.)
  - What get_http_headers() returns
  - Which fallback path is taken
  - Final outcome

This will finally give us visibility into what's happening.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants