Fixing Extract and Enhance - #2
Open
Alicorn-Max-S wants to merge 3 commits into
Open
Conversation
get_http_request() already returns a Starlette Request, but it was being
re-wrapped as if it were a scope mapping. Construction survives because
HTTPConnection is a Mapping over scope, so the failure only surfaced on the
first .headers access, where Headers.__init__ does
self._list = scope["headers"] = list(scope["headers"])
and raises TypeError: 'Request' object does not support item assignment.
The bare `except Exception: pass` swallowed that, leaving self.token at the
env default, which is None on the hosted multi-tenant server.
Use get_http_request() directly, drop the now-unused Request import, and
narrow the handler to RuntimeError around the get_http_request() call only.
RuntimeError is what fastmcp raises under stdio, which is the case the
handler exists to cover; the DIFFBOT_TOKEN fallback is kept for it. Header
and query-param parsing now sit outside the handler so real failures
surface instead of being swallowed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019czdCzXr51L4DmKN6wLz8K
…ally optional name, url, location, email, employer, title and school are declared Optional but had no defaults, so fastmcp marked all eight parameters required and a schema-following client could not build a valid call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019czdCzXr51L4DmKN6wLz8K
…-4p3uld Fix token resolution: extract and enhance receive None on every request
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.
These changes should fix the current extract and enhance issues. If you want more details about what changes, look at claude's commits.