Skip to content

Relax stream namespace timestamp fields#1406

Merged
jhaynie merged 1 commit intomainfrom
fix/stream-namespace-optional-timestamps
Apr 28, 2026
Merged

Relax stream namespace timestamp fields#1406
jhaynie merged 1 commit intomainfrom
fix/stream-namespace-optional-timestamps

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented Apr 23, 2026

Summary

  • allow started_at and expires_at to be omitted in stream namespace and search responses
  • keep the shared SDK compatible with Pulse payloads while the backend fix rolls out

Verification

  • cd sdk/packages/core && bun run build

Notes

  • This is compatible with the Pulse backend returning either explicit null or omitted keys for these nullable timestamps.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

The StreamNamespaceEntrySchema Zod schema was updated to make started_at and expires_at fields optional in addition to nullable, permitting stream entry objects to omit these properties.

Changes

Cohort / File(s) Summary
Stream namespace schema
packages/core/src/services/stream/namespaces.ts
Updated StreamNamespaceEntrySchema to make started_at and expires_at fields optional (z.string().nullable().optional()) instead of required nullable fields.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@agentuity-agent
Copy link
Copy Markdown

agentuity-agent Bot commented Apr 23, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🟢 Ready (deploy_e4f4e1d417fdc2c950ac59273020a60b) - 2026-04-23T15:01:45Z

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/core/src/services/stream/namespaces.ts (1)

47-47: Update description text to reflect omitted-key support.

Line 47’s description says “or null”, but the schema now also allows omission (undefined). Consider updating the wording for clarity.

Suggested wording tweak
-	expires_at: z.string().nullable().optional().describe('ISO 8601 expiration timestamp or null'),
+	expires_at: z.string().nullable().optional().describe('ISO 8601 expiration timestamp, null, or omitted'),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/services/stream/namespaces.ts` at line 47, The description
for the expires_at schema entry (expires_at: z.string().nullable().optional())
is inaccurate because it only mentions “or null” while the schema also allows
omission/undefined; update the describe(...) text to mention “or null or omitted
(undefined)” or similar wording so it reflects nullable + optional
support—locate the expires_at field in namespaces.ts and change its describe
string accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/core/src/services/stream/namespaces.ts`:
- Line 47: The description for the expires_at schema entry (expires_at:
z.string().nullable().optional()) is inaccurate because it only mentions “or
null” while the schema also allows omission/undefined; update the describe(...)
text to mention “or null or omitted (undefined)” or similar wording so it
reflects nullable + optional support—locate the expires_at field in
namespaces.ts and change its describe string accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8332b2b-3668-4e76-932e-ce484e1d6333

📥 Commits

Reviewing files that changed from the base of the PR and between 4f3d17d and fd4dc67.

📒 Files selected for processing (1)
  • packages/core/src/services/stream/namespaces.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome as code formatter with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/core/src/services/stream/namespaces.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript Strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/core/src/services/stream/namespaces.ts
packages/core/src/**/*.ts

📄 CodeRabbit inference engine (packages/core/AGENTS.md)

packages/core/src/**/*.ts: Build TypeScript with bun run build command
Run TypeScript type checking with bun run typecheck command
Ensure runtime compatibility with both Browser and Node/Bun environments with no runtime-specific code
Build target must be ESNext with TypeScript declaration files
Prefer interfaces for public APIs
Use generics for reusable type utilities
Ensure no side effects in all exports - all exports must be pure with no global mutations
All relative imports in TypeScript files MUST include the .ts extension
Run bun run build before publishing to compile TypeScript

Files:

  • packages/core/src/services/stream/namespaces.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/core/src/services/stream/namespaces.ts
🔇 Additional comments (1)
packages/core/src/services/stream/namespaces.ts (1)

43-43: Good compatibility fix for started_at optionality.

Line 43 correctly widens the schema to accept both null and omitted values, matching the PR goal.

@github-actions
Copy link
Copy Markdown

📦 Canary Packages Published

version: 2.0.9-fd4dc67

Packages
Package Version URL
@agentuity/webhook 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-webhook-2.0.9-fd4dc67.tgz
@agentuity/react 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-react-2.0.9-fd4dc67.tgz
@agentuity/server 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-server-2.0.9-fd4dc67.tgz
@agentuity/drizzle 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-drizzle-2.0.9-fd4dc67.tgz
@agentuity/migrate 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-migrate-2.0.9-fd4dc67.tgz
@agentuity/task 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-task-2.0.9-fd4dc67.tgz
@agentuity/runtime 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-runtime-2.0.9-fd4dc67.tgz
@agentuity/keyvalue 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-keyvalue-2.0.9-fd4dc67.tgz
@agentuity/coder 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-2.0.9-fd4dc67.tgz
@agentuity/sandbox 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-sandbox-2.0.9-fd4dc67.tgz
@agentuity/evals 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-evals-2.0.9-fd4dc67.tgz
@agentuity/workbench 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-workbench-2.0.9-fd4dc67.tgz
@agentuity/cli 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-cli-2.0.9-fd4dc67.tgz
@agentuity/core 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-core-2.0.9-fd4dc67.tgz
@agentuity/frontend 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-frontend-2.0.9-fd4dc67.tgz
@agentuity/opencode 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-opencode-2.0.9-fd4dc67.tgz
@agentuity/schema 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schema-2.0.9-fd4dc67.tgz
@agentuity/claude-code 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-claude-code-2.0.9-fd4dc67.tgz
@agentuity/schedule 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schedule-2.0.9-fd4dc67.tgz
@agentuity/postgres 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-postgres-2.0.9-fd4dc67.tgz
@agentuity/email 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-email-2.0.9-fd4dc67.tgz
@agentuity/auth 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-auth-2.0.9-fd4dc67.tgz
@agentuity/vector 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-vector-2.0.9-fd4dc67.tgz
@agentuity/coder-tui 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-tui-2.0.9-fd4dc67.tgz
@agentuity/db 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-db-2.0.9-fd4dc67.tgz
@agentuity/queue 2.0.9-fd4dc67 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-queue-2.0.9-fd4dc67.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-webhook-2.0.9-fd4dc67.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-react-2.0.9-fd4dc67.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-server-2.0.9-fd4dc67.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-drizzle-2.0.9-fd4dc67.tgz",
    "@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-migrate-2.0.9-fd4dc67.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-task-2.0.9-fd4dc67.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-runtime-2.0.9-fd4dc67.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-keyvalue-2.0.9-fd4dc67.tgz",
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-2.0.9-fd4dc67.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-sandbox-2.0.9-fd4dc67.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-evals-2.0.9-fd4dc67.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-workbench-2.0.9-fd4dc67.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-cli-2.0.9-fd4dc67.tgz",
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-core-2.0.9-fd4dc67.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-frontend-2.0.9-fd4dc67.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-opencode-2.0.9-fd4dc67.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schema-2.0.9-fd4dc67.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-claude-code-2.0.9-fd4dc67.tgz",
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schedule-2.0.9-fd4dc67.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-postgres-2.0.9-fd4dc67.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-email-2.0.9-fd4dc67.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-auth-2.0.9-fd4dc67.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-vector-2.0.9-fd4dc67.tgz",
    "@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-tui-2.0.9-fd4dc67.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-db-2.0.9-fd4dc67.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-queue-2.0.9-fd4dc67.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-webhook-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-react-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-server-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-drizzle-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-migrate-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-task-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-runtime-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-keyvalue-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-sandbox-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-evals-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-workbench-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-cli-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-core-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-frontend-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-opencode-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schema-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-claude-code-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-schedule-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-postgres-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-email-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-auth-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-vector-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-coder-tui-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-db-2.0.9-fd4dc67.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-fd4dc67/agentuity-queue-2.0.9-fd4dc67.tgz

@jhaynie jhaynie merged commit 1a5edb2 into main Apr 28, 2026
18 of 19 checks passed
@jhaynie jhaynie deleted the fix/stream-namespace-optional-timestamps branch April 28, 2026 18:02
Huijiro added a commit that referenced this pull request Apr 28, 2026
Brings in 10 commits from main on top of the v3 branch:
  - More perf improvements (#1416)
  - Relax stream namespace timestamp fields (#1406)
  - feat: add per-sandbox paused timeout support (#1392)
  - fix(ci): handle successful docs sync transport errors (#1415)
  - Update stale docs (#1404)
  - feat(docs): add Pagefind keyword search (#1412)
  - fix(ci): run release-next tests with test env (#1414)
  - Add coder Hub rpc_ready protocol event (#1413)
  - fix(docs): improve Ask AI query handling (#1411)
  - Move default template from agent pattern to route-only (#1386)

Conflict resolutions:

  Modify/delete (deleted on v3, kept deleted — main's edits dropped):
    - packages/cli/src/cmd/build/vite/vite-asset-server-config.ts
    - packages/runtime/src/middleware.ts
    - packages/runtime/src/services/sandbox/http.ts
    - templates/_base/src/api/index.ts
    - templates/default/package.overlay.json
    - templates/default/src/api/index.ts
    - templates/default/src/web/App.tsx

  File location (apps/docs -> docs rename from v3):
    - docs/src/web/lib/pagefind-search.ts (placed at v3 path)

  Content:
    - .github/workflows/release-next.yaml — deduped the NODE_ENV env block
      on the Unit tests step (both sides added it; kept main's placement
      before run:); kept v3's trailing newline.
    - docs/src/api/streaming/route.ts — kept v3's defensive runtime type
      narrowing for body.model (added by CodeRabbit feedback) but adopted
      main's default model name 'gpt-5.4-mini' to match the rest of the
      docs demo apps.
    - bun.lock — regenerated from the merged package manifests.
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