feat: add API key overview and codex inspection persistence#67
feat: add API key overview and codex inspection persistence#67janfengye wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25b94c7f77
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err != nil { | ||
| _ = m.SaveLog(context.Background(), run.RunID, LogError, err.Error()) | ||
| run.Status = string(StatusFailed) | ||
| now := time.Now().UnixMilli() |
There was a problem hiding this comment.
Keep canceled inspections out of failed state
When a user pauses/stops a run, the runner returns ctx.Err() after persisting StatusStopped, but this branch unconditionally rewrites the run as failed. That means intentional cancellations can end up shown as failures in history (and overwrite the earlier stopped/paused snapshot), which is misleading operationally and breaks status-based workflows.
Useful? React with 👍 / 👎.
| client := &http.Client{Timeout: time.Duration(max(1, settings.Timeout)) * time.Millisecond} | ||
| res, err := client.Do(req) | ||
| if err != nil { | ||
| logf(LogWarning, fmt.Sprintf("%s \u63a2\u6d4b\u5f02\u5e38\uff0c\u4fdd\u7559\u8d26\u53f7\uff1a%s", account.DisplayAccount, err.Error())) | ||
| return Result{Account: account, Action: ActionKeep, ActionReason: "\u63a2\u6d4b\u5f02\u5e38\uff0c\u4fdd\u7559\u8d26\u53f7", Error: err.Error(), UpdatedAtMS: now} |
There was a problem hiding this comment.
Apply retry setting during probe requests
The inspection settings include a retries field, but probe execution performs exactly one api-call attempt and returns immediately on transport/parse errors. In unstable networks, this creates avoidable false negatives (accounts marked as probe-exception/keep) even when operators configured retries to smooth transient failures.
Useful? React with 👍 / 👎.
| func BuildRunID(ts time.Time) string { | ||
| return ts.Format("20060102150405") |
There was a problem hiding this comment.
Generate run IDs with sub-second uniqueness
Run IDs are formatted only to second precision, so multiple starts within the same second produce identical run_id values. Because run persistence uses ON CONFLICT(run_id) DO UPDATE, concurrent/rapid starts can overwrite each other’s metadata and results, effectively corrupting run history.
Useful? React with 👍 / 👎.
Summary
Validation
Notes