Skip to content

Outpost in SDK - #15417

Merged
frankie567 merged 21 commits into
mainfrom
sdk/local-reduction
Oct 14, 2026
Merged

frankie567 merged 21 commits into
mainfrom
sdk/local-reduction

Conversation

@frankie567

@frankie567 frankie567 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member
  • sdk: add Python Outpost reduction and Redis-backed client
  • sdk: cache Outpost state locally and synchronize through Redis Pub/Sub
  • sdk: add TypeScript Outpost with local state and Redis synchronization
  • sdk: regenerate
  • sdk: build TypeScript package when installed from Git
  • sdk/ts: fake outpost snapshot command
  • sdk/e2e: add a test harness for Outpost SDK
  • sdk/e2e: more tight scenario and harness improvements
  • Revert "sdk/ts: fake outpost snapshot command"
  • sdk/outpost: remove payload validation
  • sdk/e2e: tighten concurrent scenario
  • sdk/e2e: move fake server to Python

View guided diff Turn on auto-fix

@mintlify

mintlify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Handbook 🟢 Ready View Preview Oct 14, 2026, 6:13 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbit Ready Ready Preview Oct 14, 2026 6:40pm UTC
polar-test Ready Ready Preview Oct 14, 2026 6:40pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread sdk/e2e/scenarios.py Resolved
Comment thread .github/workflows/test_sdk.yaml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 86 files

Confidence score: 2/5

  • client.ts can send authorization headers and customer data over plaintext ws:// when baseUrl uses http://. Reject non-HTTPS base URLs or require an explicit opt-in.
  • event.ts can accept out-of-range calendar dates because Date.parse normalizes them, putting events in the wrong bucket. Validate the timestamp’s calendar components before accepting it.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk/generator/typescript/template/src/outpost/event.ts">

<violation number="1" location="sdk/generator/typescript/template/src/outpost/event.ts:38">
P2: `Date.parse` normalizes out-of-range calendar dates, so invalid timestamps can silently aggregate into the wrong bucket. Validate the timestamp’s calendar components before accepting it.</violation>
</file>

<file name="sdk/generator/typescript/template/src/outpost/client.ts">

<violation number="1" location="sdk/generator/typescript/template/src/outpost/client.ts:159">
P1: Custom agent: **Flag Security Vulnerabilities**

This fallback sends the authorization headers and customer data over plaintext `ws://` whenever `baseUrl` uses `http://`. Reject non-HTTPS base URLs or require an explicit test-only insecure opt-in instead of silently downgrading to `ws://`.</violation>
</file>

Requires human review: Auto-approval blocked because this review re-detected 3 unresolved issues already reported by Cubic.

View guided diff | Turn on auto-fix | Re-trigger cubic

await withTimeout(this.synced.promise);
const [url, request] = this.options.client.buildRequest("GET", "/v1/outpost/");
const endpoint = new URL(url);
endpoint.protocol = endpoint.protocol === "https:" ? "wss:" : "ws:";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: Custom agent: Flag Security Vulnerabilities

This fallback sends the authorization headers and customer data over plaintext ws:// whenever baseUrl uses http://. Reject non-HTTPS base URLs or require an explicit test-only insecure opt-in instead of silently downgrading to ws://.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk/generator/typescript/template/src/outpost/client.ts, line 159:

<comment>This fallback sends the authorization headers and customer data over plaintext `ws://` whenever `baseUrl` uses `http://`. Reject non-HTTPS base URLs or require an explicit test-only insecure opt-in instead of silently downgrading to `ws://`.</comment>

<file context>
@@ -0,0 +1,446 @@
+      await withTimeout(this.synced.promise);
+      const [url, request] = this.options.client.buildRequest("GET", "/v1/outpost/");
+      const endpoint = new URL(url);
+      endpoint.protocol = endpoint.protocol === "https:" ? "wss:" : "ws:";
+      this.websocket = new WebSocket(endpoint, {
+        headers: Object.fromEntries(new Headers(request.headers)),
</file context>

) {
throw new TypeError("Event timestamps must include a timezone");
}
const timestamp = input.timestamp === undefined ? Date.now() : Date.parse(input.timestamp);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Date.parse normalizes out-of-range calendar dates, so invalid timestamps can silently aggregate into the wrong bucket. Validate the timestamp’s calendar components before accepting it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk/generator/typescript/template/src/outpost/event.ts, line 38:

<comment>`Date.parse` normalizes out-of-range calendar dates, so invalid timestamps can silently aggregate into the wrong bucket. Validate the timestamp’s calendar components before accepting it.</comment>

<file context>
@@ -0,0 +1,64 @@
+  ) {
+    throw new TypeError("Event timestamps must include a timezone");
+  }
+  const timestamp = input.timestamp === undefined ? Date.now() : Date.parse(input.timestamp);
+  if (!Number.isFinite(timestamp)) throw new TypeError("Invalid event timestamp");
+  return {
</file context>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 18 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 4 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 13 reviewed files. 11 files intentionally excluded from review.

Confidence score: 3/5

  • In sdk/generator/typescript/template/src/outpost/client.ts, the fractional cutoff can reject writes for the bucket starting at 12:00:00, losing usage until the next bucket. Truncate to whole seconds to match the Python SDK.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk/generator/typescript/template/src/outpost/client.ts">

<violation number="1" location="sdk/generator/typescript/template/src/outpost/client.ts:501">
P1: This fractional cutoff rejects writes for the bucket starting at `12:00:00` when `cold_until` is `12:00:00.000001`, losing usage until the next bucket. Truncate to whole seconds, matching the Python SDK.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 10 reviewed files. 9 files intentionally excluded from review.

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 6 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 4 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/test_sdk.yaml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

@frankie567
frankie567 merged commit 82081d9 into main Oct 14, 2026
27 checks passed
@frankie567
frankie567 deleted the sdk/local-reduction branch October 14, 2026 18:43

This branch was successfully deployed

3 active (1 outdated) deployments
Preview – polar-test — cad605c1 Deployed Oct 14, 2026 by vercel[bot]
Preview – orbit — cad605c1 Deployed Oct 14, 2026 by vercel[bot]
staging - handbook — da35dde5 Deployed Oct 14, 2026 by mintlify[bot]
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