Skip to content

Switch OpenAI classification to Responses API#66

Merged
WZ merged 6 commits intomainfrom
codex/openai-responses-schema
Mar 8, 2026
Merged

Switch OpenAI classification to Responses API#66
WZ merged 6 commits intomainfrom
codex/openai-responses-schema

Conversation

@WZ
Copy link
Owner

@WZ WZ commented Mar 2, 2026

Summary

  • default /list to the caller's own items and add /list all for the team view
  • add configurable openai_base_url for OpenAI-compatible endpoints
  • switch OpenAI section classification to the Responses API with schema-constrained JSON output
  • derive classification confidence locally instead of parsing model-emitted confidence
  • route other OpenAI LLM calls through the configured base URL and update docs/examples

Testing

  • GOCACHE=/tmp/reportbot-go-cache go test ./internal/config ./internal/integrations/llm ./internal/report ./internal/storage/sqlite
  • GOCACHE=/tmp/reportbot-go-cache go test ./internal/integrations/slack -run 'TestHandleBlockActions_Nudge|TestResolveNudgeTarget|TestParseListScope|TestFormatItemDescriptionForList|TestFormatListItemText_AddsLineNumber'

Copilot AI review requested due to automatic review settings March 2, 2026 06:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Slack /list behavior and migrates OpenAI integration toward OpenAI-compatible endpoints and the Responses API, aligning the bot’s UX and LLM calls with new configuration options.

Changes:

  • Default /list to “mine” scope, add /list all, and propagate scope through pagination + edit/delete flows.
  • Add configurable openai_base_url (YAML + env) and log it at startup.
  • Switch OpenAI section classification to the Responses API with JSON-schema constrained output and derive confidence locally.

Reviewed changes

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

Show a summary per file
File Description
internal/integrations/slack/slack.go Implements list scoping (mine/all), threads scope through interactions, and tweaks copy.
internal/integrations/slack/slack_logic_test.go Adds unit test coverage for parseListScope.
internal/integrations/llm/llm.go Adds Responses API request/response handling + JSON schema output for section classification; local confidence derivation.
internal/integrations/llm/llm_test.go Updates tests for schema output + local confidence logic and adds Responses output extraction test.
internal/config/config.go Adds openai_base_url to config, env override, default, and trailing-slash normalization.
internal/config/config_test.go Verifies OpenAIBaseURL default and env override behavior.
internal/app/app.go Logs OpenAIBaseURL on startup.
config.yaml Documents openai_base_url and sets default.
README.md Updates /list docs and adds OpenAI base URL + Responses API notes.

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

@WZ
Copy link
Owner Author

WZ commented Mar 8, 2026

Addressed and resolved all Copilot review threads.

Follow-up fixes included:

  • OpenAI non-structured calls now omit schema payload fields unless explicitly needed.
  • /list mine scope now falls back to caller AuthorID when Slack user lookup fails.
  • UND section confidence handling now normalizes lowercase/variant values to canonical UND (with test coverage).
  • Posting latest team report is now /generate-report post (and /generate-report post private), with docs/help updated.

Latest commits: 7e6a9ad, e2e0b64, 07927cd.

@WZ WZ merged commit 20db73a into main Mar 8, 2026
1 check passed
@WZ WZ deleted the codex/openai-responses-schema branch March 8, 2026 06:36
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