Skip to content

refactor(server): standardize generation error codes#511

Merged
davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:codex/shared-generate-error-codes
Jul 11, 2026
Merged

refactor(server): standardize generation error codes#511
davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:codex/shared-generate-error-codes

Conversation

@Graffioh

@Graffioh Graffioh commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add shared, typed GenerateErrorCode values across all generation backends
  • represent result state with a single std::optional<GenerateError> instead of separate boolean, enum, and string fields
  • expose ok(), succeed(), and fail() helpers to keep success and failure states consistent
  • serialize stable daemon error codes while retaining backend-specific details in logs

Why

Equivalent failures previously used inconsistent free-form strings such as prefill/prefill_failed, decode/decode_failed, and bad slot/invalid_snapshot_slot. The typed error model makes shared failures consistent and compiler-checked without losing architecture-specific diagnostics.

Compatibility

The daemon response shape remains err <code>, but recurrent legacy values are normalized to descriptive codes such as prefill_failed, decode_failed, context_overflow, and invalid_snapshot_slot. Backend-specific failures now use backend_specific; their detailed diagnostics remain available in server logs.

Validation

  • compiled and ran a focused error-state and serialization check
  • syntax-checked the daemon and LayerSplit backend
  • added GenerateResult state-consistency coverage
  • ran git diff --check

Review in cubic

@Graffioh Graffioh force-pushed the codex/shared-generate-error-codes branch from c2e335a to b040198 Compare July 11, 2026 12:12
@Graffioh Graffioh marked this pull request as ready for review July 11, 2026 12:20

@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.

No issues found across 12 files

Re-trigger cubic

@davide221 davide221 merged commit 2f8d08f into Luce-Org:main Jul 11, 2026
1 check passed
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.

2 participants