Conversation
This change allows prompt handlers to access the current context, enabling more dynamic prompt generation and improved logging. It also introduces backward compatibility for existing handlers. Co-authored-by: evan <evan@arcade.dev>
|
Cursor Agent can help with this pull request. Just |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Co-authored-by: evan <evan@arcade.dev>
Co-authored-by: evan <evan@arcade.dev>
|
Cursor Agent can help with this pull request. Just |
Co-authored-by: evan <evan@arcade.dev>
Co-authored-by: evan <evan@arcade.dev>
Co-authored-by: evan <evan@arcade.dev>
Co-authored-by: evan <evan@arcade.dev>
|
Cursor Agent can help with this pull request. Just |
|
@cursoragent roll back the latest commit |
|
I can do that, but quick check: do you want a safe revert (adds a new commit that undoes the latest one), or a history rewrite (reset/force-push)?
Tell me which one you prefer and I’ll proceed. Learn more about Cursor Agents |
|
@cursoragent roll back the latest commit |
|
I can roll back the latest commit.
Which approach do you want? Learn more about Cursor Agents |
Add
contextparameter support to Python prompt handlers for SDK parity and future-proofing, while ensuring backward compatibility.This change uses
inspect.signatureto detect if a prompt handler accepts thecontextparameter, allowing both new and legacy handler signatures to coexist without breaking existing code.Linear Issue: TOO-202
Note
Introduce context parameter support for Python prompt handlers, automatically detected and propagated through Context and Server while preserving legacy handlers.
PromptHandlerTypesupporting both legacyhandler(args)and newhandler(context, args)signatures with introspection-based detection.PromptHandler.get_messagesandPromptManager.get_promptto accept/passcontext; raisePromptErrorif required context is missing.get_type_hints,Annotated/Unionunwrap, safe string refs) and cast results.Prompts.getto forward the activeContextto the prompt manager._handle_get_promptnow retrieves the current model context and passes it to the prompt manager.1.14.1.Written by Cursor Bugbot for commit d9d1544. This will update automatically on new commits. Configure here.