Skip to content

fix: resolve TypeScript strict mode errors in providerErrorHandler.ts#720

Merged
Wirasm merged 4 commits intocoleam00:mainfrom
jonahgabriel:fix/typescript-strict-mode-686
Sep 22, 2025
Merged

fix: resolve TypeScript strict mode errors in providerErrorHandler.ts#720
Wirasm merged 4 commits intocoleam00:mainfrom
jonahgabriel:fix/typescript-strict-mode-686

Conversation

@jonahgabriel
Copy link
Copy Markdown

Summary

Resolves TypeScript strict mode errors in providerErrorHandler.ts by implementing proper type guards and type-safe property access patterns.

Changes Made

  • Type Interface Definitions: Added ErrorWithStatus and ErrorWithMessage interfaces for type safety
  • Type Guard Functions: Implemented hasStatusProperty() and hasMessageProperty() for safe property access
  • Refactored Error Handling: Replaced unsafe property access with type guard checks
  • Code Quality Improvements: Applied biome linting fixes (optional chaining and formatting)

Technical Details

  • All 8 TypeScript strict mode errors have been resolved
  • Maintains 100% backward compatibility - no breaking changes
  • Follows TypeScript best practices for type safety
  • Passes all existing functionality tests (11/11 tests pass)

Test Results

✅ TypeScript compilation: No errors in strict mode
✅ Biome linting: Clean with no warnings
✅ Functionality tests: All 11 tests passing
✅ Error handling: Maintains all existing behavior patterns

Files Changed

  • archon-ui-main/src/features/knowledge/utils/providerErrorHandler.ts

Fixes #686

Test plan

  • Verify TypeScript strict mode compilation passes
  • Run biome linting to ensure code quality standards
  • Test all error handling scenarios (basic errors, status codes, structured provider errors)
  • Verify graceful handling of edge cases (null, undefined, malformed JSON)
  • Confirm user-friendly error message generation works correctly

OmniNode CI and others added 4 commits September 20, 2025 14:40
- Add proper type guards for error object property access
- Create ErrorWithStatus and ErrorWithMessage interfaces
- Implement hasStatusProperty() and hasMessageProperty() type guards
- Replace unsafe object property access with type-safe checks
- All 8 TypeScript strict mode errors now resolved
- Maintains existing functionality for LLM provider error handling

Fixes coleam00#686
- Use optional chaining instead of logical AND for property access
- Improve formatting for better readability
- Maintain all existing functionality while addressing linter warnings
- Remove unnecessary .claude-flow metrics files
- Clean up repository structure
…trict mode fixes

- Added 24 comprehensive tests for parseProviderError and getProviderErrorMessage
- Tests cover all error scenarios: basic errors, status codes, structured provider errors, malformed JSON, null/undefined handling, and TypeScript strict mode compliance
- Fixed null/undefined handling in parseProviderError to properly return fallback messages
- All tests passing (24/24) ensuring TypeScript strict mode fixes work correctly
- Validates error handling for OpenAI, Google AI, Anthropic, and other LLM providers

Related to PR coleam00#720 TypeScript strict mode compliance
Copy link
Copy Markdown
Collaborator

@Wirasm Wirasm left a comment

Choose a reason for hiding this comment

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

Great work @jonahgabriel! this is a great fix, and excellent test coverage!

@Wirasm Wirasm merged commit 7a4c67c into coleam00:main Sep 22, 2025
7 checks passed
@jonahgabriel
Copy link
Copy Markdown
Author

Great work @jonahgabriel! this is a great fix, and excellent test coverage!

Thanks!

@jonahgabriel jonahgabriel deleted the fix/typescript-strict-mode-686 branch September 22, 2025 11:24
jonahgabriel added a commit to jonahgabriel/Archon that referenced this pull request Sep 23, 2025
…trict mode fixes

- Added 24 comprehensive tests for parseProviderError and getProviderErrorMessage
- Tests cover all error scenarios: basic errors, status codes, structured provider errors, malformed JSON, null/undefined handling, and TypeScript strict mode compliance
- Fixed null/undefined handling in parseProviderError to properly return fallback messages
- All tests passing (24/24) ensuring TypeScript strict mode fixes work correctly
- Validates error handling for OpenAI, Google AI, Anthropic, and other LLM providers

Related to PR coleam00#720 TypeScript strict mode compliance
leonj1 pushed a commit to leonj1/Archon that referenced this pull request Oct 13, 2025
…coleam00#720)

* fix: resolve TypeScript strict mode errors in providerErrorHandler.ts

- Add proper type guards for error object property access
- Create ErrorWithStatus and ErrorWithMessage interfaces
- Implement hasStatusProperty() and hasMessageProperty() type guards
- Replace unsafe object property access with type-safe checks
- All 8 TypeScript strict mode errors now resolved
- Maintains existing functionality for LLM provider error handling

Fixes coleam00#686

* fix: apply biome linting improvements to providerErrorHandler.ts

- Use optional chaining instead of logical AND for property access
- Improve formatting for better readability
- Maintain all existing functionality while addressing linter warnings

* chore: remove .claude-flow directory

- Remove unnecessary .claude-flow metrics files
- Clean up repository structure

* Add comprehensive test coverage for providerErrorHandler TypeScript strict mode fixes

- Added 24 comprehensive tests for parseProviderError and getProviderErrorMessage
- Tests cover all error scenarios: basic errors, status codes, structured provider errors, malformed JSON, null/undefined handling, and TypeScript strict mode compliance
- Fixed null/undefined handling in parseProviderError to properly return fallback messages
- All tests passing (24/24) ensuring TypeScript strict mode fixes work correctly
- Validates error handling for OpenAI, Google AI, Anthropic, and other LLM providers

Related to PR coleam00#720 TypeScript strict mode compliance

---------

Co-authored-by: OmniNode CI <noreply@omninode.ai>
coleam00 pushed a commit that referenced this pull request Apr 7, 2026
#721)

Message created_at was parsed as local time while workflow started_at
used ensureUtc (UTC). For users east of UTC, this timezone mismatch
caused the startedAt filter to exclude all messages, resulting in
empty workflow execution logs.

Co-authored-by: Thomas Ritter <thomas.ritter@crownpeak.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
…am00#720) (coleam00#721)

Message created_at was parsed as local time while workflow started_at
used ensureUtc (UTC). For users east of UTC, this timezone mismatch
caused the startedAt filter to exclude all messages, resulting in
empty workflow execution logs.

Co-authored-by: Thomas Ritter <thomas.ritter@crownpeak.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
joaobmonteiro pushed a commit to joaobmonteiro/Archon that referenced this pull request Apr 26, 2026
…am00#720) (coleam00#721)

Message created_at was parsed as local time while workflow started_at
used ensureUtc (UTC). For users east of UTC, this timezone mismatch
caused the startedAt filter to exclude all messages, resulting in
empty workflow execution logs.

Co-authored-by: Thomas Ritter <thomas.ritter@crownpeak.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Fix TypeScript strict mode errors in providerErrorHandler.ts

2 participants