Skip to content

feat: workflow の sdk 記述方法を変更#9

Merged
yu-sugimoto merged 2 commits into
mainfrom
feat/workflow-prompt
Mar 4, 2026
Merged

feat: workflow の sdk 記述方法を変更#9
yu-sugimoto merged 2 commits into
mainfrom
feat/workflow-prompt

Conversation

@yu-sugimoto

Copy link
Copy Markdown
Collaborator

会話を記憶させるため SDKClient に変更

  • 会話ログはメモリに記憶されるため k8s の各コンテナを跨ぐことはないと判断

Copilot AI review requested due to automatic review settings March 4, 2026 04:41
@yu-sugimoto yu-sugimoto merged commit d4ec0bd into main Mar 4, 2026
9 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

ワーカー側の Claude Agent SDK 利用を ClaudeSDKClient ベースに寄せ、同一セッション内で会話コンテキストを維持したまま「起動→スクショ」など複数ステップを実行できるようにする PR です。あわせて、フロントエンドのログ表示フェーズに launching を追加し、進捗表示を改善しています。

Changes:

  • ClaudeSDKClient を導入し、同一セッションで dev server 起動とスクリーンショット取得を連続実行するフローを追加
  • メッセージ/ツールログ処理を receive_response() ベースに切り出し(analyze/implement 両方)
  • フロントのログフェーズ表示に launching を追加し、文言を調整

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
frontend/src/components/LogPanel.tsx ログ表示フェーズのラベル更新(cloning 文言変更、launching 追加)
docker/worker-implement.py 実装後の「起動→after スクショ」を ClaudeSDKClient セッション内で分割実行する処理を追加
docker/worker-analyze.py 「起動→before スクショ」を ClaudeSDKClient セッション内で分割実行する処理に変更

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +156 to +160
async def _process_messages(client: ClaudeSDKClient, phase: str) -> None:
"""Process messages from ClaudeSDKClient, emitting logs for a given phase."""
current_tool = None
tool_input_chunks = ""

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

_process_messages() (and the related launch_and_screenshot() flow below) duplicates essentially the same streaming/log parsing logic that also exists in docker/worker-analyze.py. Having two copies makes future SDK/event-shape changes easy to miss in one worker. Consider extracting this into a small shared helper module (e.g., docker/claude_streaming.py) imported by both workers, or factor the common loop to accept an async iterator so both query() and ClaudeSDKClient can reuse the same implementation.

Copilot uses AI. Check for mistakes.
Comment thread docker/worker-analyze.py
Comment on lines +102 to 106
async def _process_messages(client: ClaudeSDKClient, phase: str) -> None:
"""Process messages from ClaudeSDKClient, emitting logs for a given phase."""
current_tool = None
tool_input_chunks = ""

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

_process_messages() (and launch_and_screenshot() below) duplicates the same Claude streaming/tool-log parsing code that now also exists in docker/worker-implement.py. This duplication increases maintenance cost and the chance that a future SDK change (event types / fields) is applied in only one worker. Consider moving the shared logic into a common helper module and importing it from both scripts.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants