Skip to content

[Control Plane] Track custom metadata added to context of exec endpoints #988

Description

@pocesar

Summary

Instead of adding a new field to the pydantic model for reasoner and constantly passing down the same data over and over (say, user_id, profile_url), it would be great if any type of data would be kept by the control plane and be accessed by any reasoner, skill or different agents without doing manual prop drilling.

Proposed solution

The ExecutionContext would allow to resolve any data that came to the /exec endpoint in the context payload part and store it. Calling get_current_context().some_custom_field would match any of the custom attached metadata and retrieve it. Similar to how memory works but static data that is available throughout the full execution.

Alternatives considered

Keep adding more fields to pydantic models and keep passing down at every app.call() callsite, manually enriching the payload to avoid repetition

Additional context

Sometimes you want to give information that won't be useful to AF but is when forwarding to another service (like Claude or OpenAI). Those extra fields can make or break a complex workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions