Skip to content

Add emit_message_history to record an agent transcript without seeding it - #74811

Open
pankajastro wants to merge 2 commits into
apache:mainfrom
pankajastro:afl-271-push-the-agent-transcript-to-xcom-without-seeding
Open

pankajastro wants to merge 2 commits into
apache:mainfrom
pankajastro:afl-271-push-the-agent-transcript-to-xcom-without-seeding

Conversation

@pankajastro

@pankajastro pankajastro commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

AgentOperator pushes the transcript to XCom only when message_history is not None.
A single-turn agent that only wants its transcript recorded has to pass message_history=[],
which is the parameter for seeding a conversation.

This adds emit_message_history: bool | None = None:

  • None (default): push the transcript when message_history is set, as before.
  • True: also push it for a run without message_history; the run is not seeded.
  • False: keep a seeded run from pushing it.

emit_message_history resolving to True together with enable_hitl_review raises, for the
same reason message_history does: the post-review transcript is not recoverable.


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code)

Generated-by: Claude Code (Sonnet 5.5) following the guidelines

🤖 Generated with Claude Code

Comment thread providers/common/ai/src/airflow/providers/common/ai/operators/agent.py Outdated
Comment thread providers/common/ai/src/airflow/providers/common/ai/operators/agent.py Outdated
Comment thread providers/common/ai/docs/message_history.rst

@kaxil kaxil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

pankajastro and others added 2 commits October 20, 2026 11:32
…g it

Single-turn agents that want their transcript on XCom had to pass
message_history=[], a parameter for seeding a conversation, not for
observing a run. A dedicated flag states that intent directly, and
do_xcom_push=False now also suppresses the transcript push, as it does
the other XCom pushes.

Co-Authored-By: Claude <noreply@anthropic.com>
Gating the transcript push on do_xcom_push also stopped it for
message_history users, narrowing a stable feature. A tri-state
emit_message_history defaults to whether the run is seeded, so existing
sessions keep pushing, a single-turn run can opt in, and a seeded run
can opt out.

Co-Authored-By: Claude <noreply@anthropic.com>
@pankajastro
pankajastro force-pushed the afl-271-push-the-agent-transcript-to-xcom-without-seeding branch from 39a4c59 to 36325dd Compare October 20, 2026 06:03
@pankajastro

Copy link
Copy Markdown
Member Author

CI failure is unrelated PR: #75188 should fix it

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants