Add support for 'skipped' result in decision log and dashboard snapshot#1
Add support for 'skipped' result in decision log and dashboard snapshot#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ed77a506a
ℹ️ 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".
| return { | ||
| usdcBalance: BigInt(0), | ||
| totalPortfolioUsd: 0, | ||
| positions: [], | ||
| lastUpdatedAt: new Date().toISOString(), |
There was a problem hiding this comment.
Skip execution when no user vault exists
When getVault returns the zero address, this path sets treasury balances to zero instead of failing closed at decision time. In that state, a buy can still be risk-approved with effectiveSizeUsd = 0, and runExecute proceeds until execute throws Resolved amountIn is zero, causing the whole cycle to fail rather than logging a normal blocked/skipped decision. This now impacts new or unfunded users whose vault has not been created yet.
Useful? React with 👍 / 👎.
| if (autopilotSessions.length === 0) { | ||
| await runCycle(config, "cron"); | ||
| } else { | ||
| for (const session of autopilotSessions) { | ||
| await runCycle(config, "cron", session); |
There was a problem hiding this comment.
Keep global cron cycle running with session autopilot
This branch disables the global cycle as soon as any autopilot session exists, and only runs session-scoped cycles thereafter. Because global state is still what /api/status and the x402 runtime getters expose in this file, those outputs become stale once a single user session is active. Running the global cycle in addition to per-session cycles (or migrating those consumers to session-aware data) would prevent that regression.
Useful? React with 👍 / 👎.
No description provided.