-
Notifications
You must be signed in to change notification settings - Fork 0
test(oai): add unit tests for SSE, temperature clamping, idempotency key; broaden retryable timeout detection #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
Is this a duplicate PR?
Merge conflicts must be resolved.
…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
|
Rebased onto latest main; resolved conflicts in prestage, cache, messages IO, hygiene, and .gitignore. Force-pushed with lease. CI will re-run. |
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflicts must be resolved.
thejhh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflicts must be resolved.
Summary
internal/oaifor:newLineReader(SSE line reader)isRetryableError.Rationale
./work/develop.Links
Test plan
make testandgo test ./... -coverpass locally.