Skip to content

[WIP] Fix CI build and test errors#1042

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-one-more-time
Apr 1, 2026
Merged

[WIP] Fix CI build and test errors#1042
hotlong merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

  • Investigate CI failures — identified @objectstack/client#test as the only failing job
  • Identify root cause: client.ai.chat() method was removed (line 1210 comment) but test still called it
  • Fix the failing test in packages/client/src/client.test.ts to match the current API
  • Verify all 88 client tests pass locally
  • Verify full test suite passes (83/83 turbo tasks successful)
  • Update CHANGELOG.md
  • Code review — no issues found
  • CodeQL security scan — no alerts

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
objectstack-play Ready Ready Preview, Comment Apr 1, 2026 8:10am
spec Ready Ready Preview, Comment Apr 1, 2026 8:10am

Request Review

The ai.chat() method was intentionally removed from ObjectStackClient
(consumers should use Vercel AI SDK useChat() directly), but the test
still called it causing TypeError. Replaced the test with an assertion
that the method is absent from the API surface.

Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/3bdafba4-a143-4f0e-97a6-7cf1e060da27

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@hotlong hotlong marked this pull request as ready for review April 1, 2026 08:03
Copilot AI review requested due to automatic review settings April 1, 2026 08:03
@hotlong hotlong merged commit b73adfc into main Apr 1, 2026
3 of 5 checks passed
Copilot AI requested a review from xuyushun441-sys April 1, 2026 08:04
Copilot stopped work on behalf of xuyushun441-sys due to an error April 1, 2026 08:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to unblock CI by updating the @objectstack/client test suite to reflect the current client API (specifically, the removal of client.ai.chat()), while also refreshing auto-generated API reference docs and the changelog to match recent spec changes.

Changes:

  • Update client AI tests to stop calling the removed client.ai.chat() method and assert it’s not part of the API surface.
  • Regenerate/adjust API reference documentation pages and navigation (including a new core-services page).
  • Add an Unreleased changelog entry describing the CI/test fix.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/client/src/client.test.ts Replaces the obsolete ai.chat() test with an assertion that chat is not exposed on client.ai.
content/docs/references/api/protocol.mdx Updates the “Validate data” example to parse AiInsightsRequest.
content/docs/references/api/plugin-rest-api.mdx Expands docs to include handler status / coverage schemas and updates import examples.
content/docs/references/api/dispatcher.mdx Adds dispatcher error code/response docs and updates import examples.
content/docs/references/api/discovery.mdx Updates ServiceStatus docs and adds RouteHealthEntry/Report docs and imports.
content/docs/references/api/meta.json Adds core-services to API reference navigation.
content/docs/references/api/core-services.mdx New API reference page for “Core Services”.
CHANGELOG.md Adds an Unreleased “Fixed” entry describing the client test update.

Comment on lines 39 to +43
import { AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, AutomationTriggerRequest, AutomationTriggerResponse, BatchDataRequest, BatchDataResponse, CheckPermissionRequest, CheckPermissionResponse, CreateDataRequest, CreateDataResponse, CreateManyDataRequest, CreateManyDataResponse, DeleteDataRequest, DeleteDataResponse, DeleteManyDataRequest, DeleteManyDataResponse, DeleteViewRequest, DeleteViewResponse, FindDataRequest, FindDataResponse, GetDataRequest, GetDataResponse, GetDiscoveryRequest, GetDiscoveryResponse, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetFieldLabelsRequest, GetFieldLabelsResponse, GetLocalesRequest, GetLocalesResponse, GetMetaItemCachedRequest, GetMetaItemCachedResponse, GetMetaItemRequest, GetMetaItemResponse, GetMetaItemsRequest, GetMetaItemsResponse, GetMetaTypesRequest, GetMetaTypesResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetObjectPermissionsRequest, GetObjectPermissionsResponse, GetPresenceRequest, GetPresenceResponse, GetTranslationsRequest, GetTranslationsResponse, GetUiViewRequest, GetViewRequest, GetWorkflowConfigRequest, GetWorkflowConfigResponse, GetWorkflowStateRequest, GetWorkflowStateResponse, HttpFindQueryParams, ListNotificationsRequest, ListNotificationsResponse, ListViewsRequest, MarkAllNotificationsReadRequest, MarkAllNotificationsReadResponse, MarkNotificationsReadRequest, MarkNotificationsReadResponse, NotificationPreferences, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeDisconnectRequest, RealtimeDisconnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RealtimeUnsubscribeRequest, RealtimeUnsubscribeResponse, RegisterDeviceRequest, RegisterDeviceResponse, SaveMetaItemRequest, SaveMetaItemResponse, SetPresenceRequest, SetPresenceResponse, UnregisterDeviceRequest, UnregisterDeviceResponse, UpdateDataRequest, UpdateDataResponse, UpdateManyDataRequest, UpdateManyDataResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowState, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';
import type { AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, AutomationTriggerRequest, AutomationTriggerResponse, BatchDataRequest, BatchDataResponse, CheckPermissionRequest, CheckPermissionResponse, CreateDataRequest, CreateDataResponse, CreateManyDataRequest, CreateManyDataResponse, DeleteDataRequest, DeleteDataResponse, DeleteManyDataRequest, DeleteManyDataResponse, DeleteViewRequest, DeleteViewResponse, FindDataRequest, FindDataResponse, GetDataRequest, GetDataResponse, GetDiscoveryRequest, GetDiscoveryResponse, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetFieldLabelsRequest, GetFieldLabelsResponse, GetLocalesRequest, GetLocalesResponse, GetMetaItemCachedRequest, GetMetaItemCachedResponse, GetMetaItemRequest, GetMetaItemResponse, GetMetaItemsRequest, GetMetaItemsResponse, GetMetaTypesRequest, GetMetaTypesResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetObjectPermissionsRequest, GetObjectPermissionsResponse, GetPresenceRequest, GetPresenceResponse, GetTranslationsRequest, GetTranslationsResponse, GetUiViewRequest, GetViewRequest, GetWorkflowConfigRequest, GetWorkflowConfigResponse, GetWorkflowStateRequest, GetWorkflowStateResponse, HttpFindQueryParams, ListNotificationsRequest, ListNotificationsResponse, ListViewsRequest, MarkAllNotificationsReadRequest, MarkAllNotificationsReadResponse, MarkNotificationsReadRequest, MarkNotificationsReadResponse, NotificationPreferences, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeDisconnectRequest, RealtimeDisconnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RealtimeUnsubscribeRequest, RealtimeUnsubscribeResponse, RegisterDeviceRequest, RegisterDeviceResponse, SaveMetaItemRequest, SaveMetaItemResponse, SetPresenceRequest, SetPresenceResponse, UnregisterDeviceRequest, UnregisterDeviceResponse, UpdateDataRequest, UpdateDataResponse, UpdateManyDataRequest, UpdateManyDataResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowState, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';

// Validate data
const result = AiNlqRequest.parse(data);
const result = AiInsightsRequest.parse(data);
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The TypeScript snippet imports the same symbols twice (value import + import type with identical names). In TypeScript this causes duplicate import/identifier issues, and it’s also unnecessary here since .parse() requires the runtime Zod schema. Suggest removing the import type { ... } line (or consolidating into a single import with type modifiers only for names that are type-only exports).

Copilot uses AI. Check for mistakes.
import { ErrorHandlingConfig, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, ValidationMode } from '@objectstack/spec/api';
import type { ErrorHandlingConfig, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, ValidationMode } from '@objectstack/spec/api';
import { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api';
import type { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api';
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The TypeScript usage example imports the same names twice (runtime import + import type with identical identifiers). This won’t compile in TS and is misleading because .parse() needs the runtime Zod schema. Keep only the value import (or use a single import with type modifiers for type-only exports) to avoid duplicate imports.

Suggested change
import type { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api';

Copilot uses AI. Check for mistakes.
import { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api';
import type { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api';
import { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api';
import type { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api';
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The TypeScript snippet imports DispatcherConfig/DispatcherErrorCode/etc twice (normal import + import type with the same identifiers). That pattern doesn’t compile and is confusing since .parse() requires the runtime schema values. Remove the duplicate import type line, or consolidate into a single import using type modifiers only where needed.

Suggested change
import type { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api';

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +17

not been verified (may 501 at runtime).

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The Service Status bullet list has a wrapped line that’s not indented, so not been verified (may 501 at runtime). renders as a separate paragraph instead of part of the registered bullet. Indent continuation lines to keep the explanation within the same list item.

Suggested change
not been verified (may 501 at runtime).
not been verified (may 501 at runtime).

Copilot uses AI. Check for mistakes.
import { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
import type { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
import { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
import type { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The TypeScript usage snippet imports the same identifiers twice (value import + import type with identical names). This is invalid TS and is unnecessary because the .parse() call needs the runtime Zod schema. Remove the duplicate import type line or consolidate into a single import that only marks genuinely type-only exports as type.

Suggested change
import type { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +38
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

<Callout type="info">
**Source:** `packages/spec/src/api/core-services.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { ServiceStatus } from '@objectstack/spec/api';
import type { ServiceStatus } from '@objectstack/spec/api';

// Validate data
const result = ServiceStatus.parse(data);
```

---

## ServiceStatus

available = fully operational, registered = route declared but handler unverified, unavailable = not installed, degraded = partial, stub = placeholder that returns 501

### Allowed Values

* `available`
* `registered`
* `unavailable`
* `degraded`
* `stub`


---

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This new page appears to be incorrectly generated/placed: the Source callout points to packages/spec/src/api/core-services.zod.ts, but that file doesn’t exist, and there’s already a System-level Core Services reference at content/docs/references/system/core-services.mdx sourced from packages/spec/src/system/core-services.zod.ts. Consider removing this API page (and its nav entry) or correcting it to reference the actual schema location and exports.

Suggested change
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}
<Callout type="info">
**Source:** `packages/spec/src/api/core-services.zod.ts`
</Callout>
## TypeScript Usage
```typescript
import { ServiceStatus } from '@objectstack/spec/api';
import type { ServiceStatus } from '@objectstack/spec/api';
// Validate data
const result = ServiceStatus.parse(data);
```
---
## ServiceStatus
available = fully operational, registered = route declared but handler unverified, unavailable = not installed, degraded = partial, stub = placeholder that returns 501
### Allowed Values
* `available`
* `registered`
* `unavailable`
* `degraded`
* `stub`
---
{/* Legacy stub: this page was auto-generated in the wrong location. */}
<Callout type="info">
**Source:** `packages/spec/src/system/core-services.zod.ts`
</Callout>
This API-level reference page has been deprecated in favor of the canonical System Core Services
documentation.
Please see: [`System / Core Services`](../system/core-services)
for the authoritative schema definition and TypeScript usage examples.
---

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +20
```typescript
import { ServiceStatus } from '@objectstack/spec/api';
import type { ServiceStatus } from '@objectstack/spec/api';

// Validate data
const result = ServiceStatus.parse(data);
```
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The TypeScript snippet imports ServiceStatus twice (normal import + import type with the same identifier), which doesn’t compile and is unnecessary because .parse() needs the runtime schema value. Remove the import type line (or consolidate imports) so the example is valid TypeScript.

Copilot uses AI. Check for mistakes.
"batch",
"connector",
"contract",
"core-services",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

core-services is added to the API reference nav, but the corresponding page (references/api/core-services.mdx) appears to be an erroneous duplicate of the existing System Core Services docs and references a non-existent source file. Recommend removing this entry from the API nav (or relocating/fixing the page under the correct section).

Suggested change
"core-services",

Copilot uses AI. Check for mistakes.
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.

4 participants