chore: ログ整形#14
Conversation
There was a problem hiding this comment.
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.pyandworker-implement.py: "Verb: object" pattern for status messages, path stripping of/workspace/repo/in tool-detail logs, and "Thinking:" prefix on Claude'sTextBlockreasoning output. instructionfield propagated fromSessionImplementationState→ Kubernetes job payload → workerplan.json→launch_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 ofrepo_dirreferences 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 inlog_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") |
There was a problem hiding this comment.
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.
| emit_log("patching", "Thinking: cumulative patch applied successfully") | |
| emit_log("patching", "Cumulative patch applied successfully") |
| check=True, | ||
| ) | ||
| emit_log("patching", "Cumulative patch applied successfully") | ||
| emit_log("patching", "Thinking: cumulative patch applied successfully") |
There was a problem hiding this comment.
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.
| emit_log("patching", "Thinking: cumulative patch applied successfully") | |
| emit_log("patching", "Cumulative patch applied successfully") |
| @@ -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})", | |||
There was a problem hiding this comment.
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.
| dist | ||
| node_modules | ||
| package-lock.json | ||
| .pytest_cache |
There was a problem hiding this comment.
.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.
| .pytest_cache |
No description provided.