refactor(config): remove unused timeout fields#503
Conversation
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| type LlmConversation struct { | ||
| Timeout int `json:"timeout"` | ||
|
|
||
| Messages []ChatMessage `json:"messages"` | ||
| } |
There was a problem hiding this comment.
Removing the Timeout field from LlmConversation will cause a compilation error in template_test.go at line 68, which references tpl.MainTask.Timeout. The test needs to be updated (the assertion should be removed) before this change can compile.
Additionally, scan_template.json still contains "timeout" values for multiple conversations (MAIN_TASK, PLAN_TASK, DEDUP_TASK, PROJECT_SUMMARY_TASK, MEMORY_COMPRESSION_TASK, RE_LOCATION_TASK). These values will now be silently ignored during JSON unmarshalling. Consider cleaning up the stale "timeout" entries from scan_template.json to avoid confusion.
ReviewThanks for picking up the cleanup from #474! The direction is right — removing the per-task timeout fields that are now dead code in the scan template path. However, the PR is incomplete and will fail to compile as-is. The Remaining references (all in the
|
| Location | Usage |
|---|---|
internal/config/testconnection/task.json |
"timeout": 120 |
internal/config/testconnection/testconnection.go |
LlmConversation.Timeout field |
cmd/opencodereview/llm_cmd.go:58-59 |
reads task.Timeout to set context.WithTimeout |
Suggested fix
To complete this cleanup:
- Remove
"timeout": 120frominternal/config/testconnection/task.json - Remove the
Timeoutfield fromtestconnection.LlmConversationstruct - Simplify
llm_cmd.go:57-60to justtimeout := 60 * time.Second— this is a connectivity test that sends one short message ("who are you"), so 60s is more than enough. The globalOCR_LLM_TIMEOUT/ client-level 5min timeout is too generous for a quick health check.
Minor: formatting
The diff leaves trailing blank lines where "timeout" was removed in the JSON and where the Timeout field was removed in the Go structs. Please clean those up to pass go fmt / keep the JSON tidy.
|
One more note: for changes that touch core structs or remove fields used across packages, please make sure to run a full local build ( |
Description
Type of Change
How Has This Been Tested?
make testpasses locallyChecklist
go fmt,go vet)Related Issues