Skip to content

fix(plugins): COMPONENT_PRE_EXECUTE payload has empty context_view #940

@araujof

Description

@araujof

Problem

Plugins using COMPONENT_PRE_EXECUTE receive None for payload.context_view, making it impossible to inspect conversation history at the component lifecycle level. The field exists on ComponentPreExecutePayload but is never populated by aact().

This forces plugin authors to use GENERATION_PRE_CALL instead, which fires later in the pipeline and requires reaching into framework internals (e.g., ReactInitiator.goal) to access user input.

Reproduction

@hook(HookType.COMPONENT_PRE_EXECUTE, mode=PluginMode.SEQUENTIAL, priority=1)
async def inspect_context(payload, ctx):
    print(payload.context_view)  # None — should be a list of context items

Expected behavior

payload.context_view should contain a snapshot of the context (via context.as_list()) at the time COMPONENT_PRE_EXECUTE fires. The context parameter is available in aact() but is not forwarded to the payload.

Related

Part of #920. The tool allowlist issue is tracked separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions