Skip to content

Conversation

@IliaMManolov
Copy link
Contributor

@IliaMManolov IliaMManolov commented Dec 4, 2025

🐛 Bug-fix PR

📌 Summary

Fixes the issue outlined here.

🔁 Reproduction Steps

See the issue above.

🐞 Root Cause

See the issue above.

💡 Fix Description

Added the two lines as mentioned in the issue above.

🧪 Verification

Check Command Status
Lint suite make lint done
Unit tests make test done
Coverage ≥ 90 % make coverage done
Manual regression no longer fails steps / screenshots done

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

Screenshots:

Screenshot 2025-12-04 at 15 10 34 Screenshot 2025-12-04 at 15 12 25

@IliaMManolov IliaMManolov force-pushed the fix_app_user_email_propagation branch from 2022d6a to 60ed09d Compare December 4, 2025 15:16
Signed-off-by: Ilia Manolov <iliamanolov@outlook.com>
@IliaMManolov IliaMManolov force-pushed the fix_app_user_email_propagation branch from 60ed09d to f8d041e Compare December 4, 2025 15:19
@IliaMManolov
Copy link
Contributor Author

Hi there, I just noticed that 3 of the CI checks failed due to an attempted write to the IBM org package. I presume it's because I don't have some permissions? I hope the PR will still be considered regardless.

@crivetimihai
Copy link
Member

Closes #1550

crivetimihai added a commit that referenced this pull request Dec 12, 2025
When invoke_tool receives an existing plugin_global_context from middleware,
the user email was not being propagated to the global context. This caused
plugins to receive user: null in their GlobalContext.

This fix ensures the user email is always propagated to the global context
when available, enabling security plugins to properly track which user
made each request.

Closes #1550
Supersedes #1551

Co-authored-by: Ilia Manolov <iliamanolov@outlook.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Member

Hi @IliaMManolov, thank you for identifying this issue and submitting the fix!

I've created #1590 which supersedes this PR. The reason is that I couldn't push to your fork (maintainer edits not enabled), and I also noticed a small bug in the condition:

# Original (checks gateway_id):
if gateway_id and isinstance(app_user_email, str):

# Fixed (checks app_user_email):
if app_user_email and isinstance(app_user_email, str):

The user email should be propagated regardless of whether a gateway_id exists.

You're credited as co-author on the new PR. Thanks again for the contribution!

crivetimihai added a commit that referenced this pull request Dec 12, 2025
When invoke_tool receives an existing plugin_global_context from middleware,
the user email was not being propagated to the global context. This caused
plugins to receive user: null in their GlobalContext.

This fix ensures the user email is always propagated to the global context
when available, enabling security plugins to properly track which user
made each request.

Closes #1550
Supersedes #1551

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Co-authored-by: Ilia Manolov <iliamanolov@outlook.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