Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RestatePlugin: after_model_callback never invoked - before_model_callback returns LlmResponse causing ADK to skip post-model hooks

オープン
#191 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

まず、RestatePlugin.before_model_callback と、Google ADK による before_model_callback の戻り値の処理を追跡します。そのフローを after_model_callback および報告されているサブクラスによる回避策と比較します。追加のプラグインが登録されている場合でも、Restate の replay セマンティクスを壊すことなく、ポストモデルフックがモデルのレスポンスと使用量メタデータを受け取れるようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Bug Description

When registering additional plugins, alongside Restate (in our case it was for ADK-level observability), after_model_callback is never invoked. This makes it impossible to access the model response and usage metadata in post-call hook, which is the natural place to capture $ai_generation events.

Environment
  • restate-sdk (version 0.16.0)
  • google-adk (1.28.1)
  • RestatePlugin
Root Cause

The ADK framework uses the return value of before_model_callback as a signal:

  • None -> proceed with the real model call, then invoke after_model_callback
  • LlmResponse -> short-circuit: skip the model call and skip after_model_callback

RestatePlugin.before_model_callback wraps the LLM call inside a Restate durable step, which means it executes the model call itself and returns a LlmResponse. This is correct for Restate's replay semantics, but it has a side effect: after_model_callback is never reached, regardless of what subclasses implement there.

Workaround

Our current workaround is to subclass (decorate) the RestatePlugin itself, so we can simulate the after_model_callback trigger inside the wrapped before_model_callback call, but we believe this is worth tracking and resolving.

主要言語
Python
スター
81
フォーク
23
平均マージ
4日 2時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

restatedev/sdk-python のほかの issue

restatedev/sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。