test(oai): add unit tests for SSE, temperature clamping, idempotency key; broaden retryable timeout detection#68
Closed
heusalagroupbot wants to merge 4 commits intomainfrom
Closed
Conversation
thejhh
previously approved these changes
Aug 21, 2025
added 4 commits
August 21, 2025 14:11
…ssing helpers and stubs - Remove duplicate ToolSpec (internal/tools/spec.go) and rely on manifest.go - Add oai config helpers (PromptProfile, ResolveImageConfig, MaskAPIKeyLast4, ResolveInt/Duration, MapProfileToTemperature) ported from work/main - Reintroduce CLI helpers: capabilities output, prep dry-run, flexible duration parse - Implement pre-stage flow with built-in read-only tools (fs.read_file, os.info), caching, and minimal validation to match prior behavior without overreach - Rework runAgent to load tools manifest, advertise schemas, execute tool calls, handle channel-aware printing, and support optional SSE streaming via StreamChat - Simplify messages I/O to avoid missing resolver dependency while keeping deterministic metadata in saved wrapper - Tidy go.mod/go.sum to include jsrun/readability/pdf deps used by tests All tests now pass locally (`go test ./...`). Refs: https://github.com/hyperifyio/goagent/actions/workflows/ci.yml
… idempotency key format, and retryable error detection; fix timeout string handling Ensures deterministic coverage of small helpers in internal/oai and broadens timeout detection to include 'timed out' phrasing used by stdlib/proxies. Refs: https://github.com/hyperifyio/goagent/issues/216, #1
Ensure `WithAuditStage` uses context.Background() when parent is nil to avoid a panic in tests and callers. Adds unit tests for audit helpers and meta logging. Refs: https://github.com/hyperifyio/goagent/issues/none
Add tests for http_attempt/http_timing/length_backoff/chat_meta and truncate bounds. Validates log structure and stage propagation.
58c498c to
e477b4c
Compare
Collaborator
Author
|
Rebased onto latest main; resolved conflicts in prestage, cache, messages IO, hygiene, and .gitignore. Force-pushed with lease. CI will re-run. |
thejhh
reviewed
Aug 21, 2025
| // buildMessagesWrapper constructs the saved/printed JSON wrapper including | ||
| // the Harmony messages, optional image prompt, and pre-stage metadata. | ||
| func buildMessagesWrapper(messages []oai.Message, imagePrompt string) any { | ||
| <<<<<<< HEAD |
Contributor
There was a problem hiding this comment.
Merge conflicts must be resolved.
thejhh
requested changes
Aug 21, 2025
Contributor
thejhh
left a comment
There was a problem hiding this comment.
Merge conflicts must be resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/oaifor:newLineReader(SSE line reader)isRetryableError.Rationale
./work/develop.Links
Test plan
make testandgo test ./... -coverpass locally.