Skip to content

Refactor request pipeline#9

Merged
merefield merged 5 commits into
mainfrom
request_pipeline
Mar 6, 2026
Merged

Refactor request pipeline#9
merefield merged 5 commits into
mainfrom
request_pipeline

Conversation

@merefield

Copy link
Copy Markdown
Owner

Summary

  • replace hand-built message history and payload JSON with jq-built structures
  • harden config bootstrap and permissions for fresh installs
  • handle transport failures, HTTP errors, and non-JSON API responses explicitly
  • add Bats coverage for config bootstrap, payload generation, and API error handling

Verification

  • make check

Fixes #7
Fixes #5
Fixes #6

Copilot AI 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.

Pull request overview

Refactors CLAI’s OpenAI request/response pipeline to keep message history and payloads as structured JSON (via jq), while hardening first-run config/state bootstrapping and adding Bats coverage for payload/error handling paths.

Changes:

  • Replace hand-built JSON string assembly/parsing with jq-constructed message history and request payloads.
  • Add explicit handling for curl transport failures, non-2xx HTTP responses, and non-JSON API responses.
  • Extend Bats smoke tests and update README to reflect the new bootstrap/error-handling behavior.

Reviewed changes

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

File Description
clai.sh Converts history/payload pipeline to jq JSON, adds config directory bootstrap + permission hardening, and improves API error handling.
test/smoke.bats Adds tests for JSON payload generation and HTTP error surfacing; refactors config setup helper.
README.md Updates documentation to describe new bootstrap behavior, JSON payload construction, and error distinctions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread clai.sh
Comment thread clai.sh Outdated
Comment thread clai.sh Outdated
Comment thread test/smoke.bats
@merefield
merefield merged commit 3024292 into main Mar 6, 2026
2 checks 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

2 participants