Skip to content

chore: ログ整形#14

Merged
yu-sugimoto merged 6 commits into
mainfrom
chore/log-custom
Mar 7, 2026
Merged

chore: ログ整形#14
yu-sugimoto merged 6 commits into
mainfrom
chore/log-custom

Conversation

@yu-sugimoto

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 7, 2026 07:56
@yu-sugimoto yu-sugimoto merged commit 20a8122 into main Mar 7, 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

This PR ("chore: ログ整形", log formatting) performs two main categories of changes: (1) reformatting log messages in the worker scripts to use a consistent "Verb: object" pattern, strip internal workspace paths from user-visible messages, and prefix Claude's AI reasoning output with "Thinking:", and (2) propagating the instruction field through the implementation pipeline so the screenshot step can navigate to the most relevant page/area.

Changes:

  • Consistent log formatting across worker-analyze.py and worker-implement.py: "Verb: object" pattern for status messages, path stripping of /workspace/repo/ in tool-detail logs, and "Thinking:" prefix on Claude's TextBlock reasoning output.
  • instruction field propagated from SessionImplementationState → Kubernetes job payload → worker plan.jsonlaunch_and_screenshot() so screenshots navigate to the page most relevant to the user's change request.
  • Minor cleanups: removal of verbose startup logs in worker-entrypoint.sh, removal of repo_dir references in AI prompts (prompts now say "the web application" rather than "the web application at {repo_dir}"), and non-structured raw log lines are now silently dropped in log_stream_client.py.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docker/worker-implement.py Log formatting, path stripping, instruction param for launch_and_screenshot, prompt cleanup
docker/worker-analyze.py Same log formatting and instruction propagation as worker-implement
docker/worker-entrypoint.sh Remove verbose startup banner
docker/worker-createpr.py Remove repo_dir from Claude prompt
backend/app/workflow/state.py Add instruction: str to SessionImplementationState
backend/app/workflow/session_implementation_graph.py Write instruction into the plan JSON sent to the worker
backend/app/usecase/session_usecase.py Thread instruction through to _run_session_implementation
backend/app/infra/log_stream_client.py Drop non-structured log lines instead of forwarding them
backend/app/infra/k8s_client.py Reformat sandbox log message to "Creating: sandbox"
frontend/src/hooks/useSessionPolling.ts Add restartPolling to resume polling after refetch detects a non-terminal session
frontend/.prettierignore Add .pytest_cache (misplaced entry)

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

check=True,
)
emit_log("patching", "Cumulative patch applied successfully")
emit_log("patching", "Thinking: cumulative patch applied successfully")

Copilot AI Mar 7, 2026

Copy link

Choose a reason for hiding this comment

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

The "Thinking:" prefix in emit_log("patching", "Thinking: cumulative patch applied successfully") is incorrect — this is a worker-side status message, not Claude's reasoning output. The "Thinking:" prefix was added to TextBlock messages emitted from Claude's AssistantMessage content to distinguish Claude's reasoning from tool actions, but it should not be applied to worker-side progress messages. This will confuse users who see "Thinking: cumulative patch applied successfully" in the log panel, when the message actually indicates a completed git operation.

Suggested change
emit_log("patching", "Thinking: cumulative patch applied successfully")
emit_log("patching", "Cumulative patch applied successfully")

Copilot uses AI. Check for mistakes.
Comment thread docker/worker-analyze.py
check=True,
)
emit_log("patching", "Cumulative patch applied successfully")
emit_log("patching", "Thinking: cumulative patch applied successfully")

Copilot AI Mar 7, 2026

Copy link

Choose a reason for hiding this comment

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

The "Thinking:" prefix in emit_log("patching", "Thinking: cumulative patch applied successfully") is incorrect — this is a worker-side status message confirming a completed git operation, not Claude's reasoning. The "Thinking:" prefix was introduced to label Claude's TextBlock reasoning output, but it should not be applied here.

Suggested change
emit_log("patching", "Thinking: cumulative patch applied successfully")
emit_log("patching", "Cumulative patch applied successfully")

Copilot uses AI. Check for mistakes.
Comment thread docker/worker-analyze.py
Comment on lines 511 to +526
@@ -461,19 +521,23 @@ async def main() -> None:
device_type = device_type.lower()
if device_type not in ("desktop", "mobile"):
device_type = "desktop"
emit_log("analyzing", f"Generated {len(proposals)} proposals (device: {device_type})")
emit_log(
"analyzing",
f"Thinking: Generated {len(proposals)} proposals (device: {device_type})",

Copilot AI Mar 7, 2026

Copy link

Choose a reason for hiding this comment

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

These two worker-side status messages — "Thinking: Generating design proposals" and "Thinking: Generated {len(proposals)} proposals (device: {device_type})" — are incorrectly prefixed with "Thinking:". These are plain worker progress messages, not Claude's reasoning output. The "Thinking:" prefix is intended to label Claude's TextBlock content from AssistantMessage. Using it here will mislead users into thinking the AI is actively reasoning when it is not.

Copilot uses AI. Check for mistakes.
Comment thread frontend/.prettierignore
dist
node_modules
package-lock.json
.pytest_cache

Copilot AI Mar 7, 2026

Copy link

Choose a reason for hiding this comment

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

.pytest_cache is generated by the Python test runner in the backend/ directory, not in the frontend/ directory. Adding it to frontend/.prettierignore is harmless but misplaced — it will never appear in the frontend directory. This entry should instead be in the backend's own ignore configuration (e.g., .gitignore at the backend level), not in the frontend's Prettier configuration.

Suggested change
.pytest_cache

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