Add auth diagnostics to research app
Browse files- README.md +1 -0
- fastmcp_research_app.py +12 -1
- research/fast-agent.yaml +1 -1
README.md
CHANGED
|
@@ -9,6 +9,7 @@ hf_oauth: true
|
|
| 9 |
hf_oauth_expiration_minutes: 480
|
| 10 |
hf_oauth_scopes:
|
| 11 |
- inference-api
|
|
|
|
| 12 |
- write-repos
|
| 13 |
- manage-repos
|
| 14 |
---
|
|
|
|
| 9 |
hf_oauth_expiration_minutes: 480
|
| 10 |
hf_oauth_scopes:
|
| 11 |
- inference-api
|
| 12 |
+
- read-repos
|
| 13 |
- write-repos
|
| 14 |
- manage-repos
|
| 15 |
---
|
fastmcp_research_app.py
CHANGED
|
@@ -231,7 +231,18 @@ async def main() -> None:
|
|
| 231 |
ctx: MCPContext,
|
| 232 |
) -> PrefabApp:
|
| 233 |
del ctx
|
| 234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
with PrefabApp(
|
| 237 |
state={
|
|
|
|
| 231 |
ctx: MCPContext,
|
| 232 |
) -> PrefabApp:
|
| 233 |
del ctx
|
| 234 |
+
auth = HarnessMCPAdapter.agent_auth()
|
| 235 |
+
job = await jobs.create(topic, auth)
|
| 236 |
+
if auth is None:
|
| 237 |
+
job.add_event("No AgentAuth was captured from the MCP app entrypoint", kind="auth")
|
| 238 |
+
else:
|
| 239 |
+
scopes = ", ".join(auth.scopes) if auth.scopes else "<none/unknown>"
|
| 240 |
+
subject = auth.subject or "<unknown>"
|
| 241 |
+
provider = auth.provider or "<unknown>"
|
| 242 |
+
job.add_event(
|
| 243 |
+
f"Captured auth provider={provider} subject={subject} scopes={scopes} token_present={bool(auth.token)}",
|
| 244 |
+
kind="auth",
|
| 245 |
+
)
|
| 246 |
|
| 247 |
with PrefabApp(
|
| 248 |
state={
|
research/fast-agent.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
default_model:
|
| 2 |
git_aware: true
|
| 3 |
|
| 4 |
logger:
|
|
|
|
| 1 |
+
default_model: $system.default
|
| 2 |
git_aware: true
|
| 3 |
|
| 4 |
logger:
|