Skip to content

Add support for 'skipped' result in decision log and dashboard snapshot#1

Open
Timidan wants to merge 1 commit intomasterfrom
fix/staleBalances
Open

Add support for 'skipped' result in decision log and dashboard snapshot#1
Timidan wants to merge 1 commit intomasterfrom
fix/staleBalances

Conversation

@Timidan
Copy link
Copy Markdown
Owner

@Timidan Timidan commented Apr 2, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +265 to +269
return {
usdcBalance: BigInt(0),
totalPortfolioUsd: 0,
positions: [],
lastUpdatedAt: new Date().toISOString(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +1170 to +1174
if (autopilotSessions.length === 0) {
await runCycle(config, "cron");
} else {
for (const session of autopilotSessions) {
await runCycle(config, "cron", session);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant