Skip to content

feat: add opt-in Responses API mode#16

Open
anvztor wants to merge 4 commits intoPsiACE:mainfrom
anvztor:feature/responses-mode
Open

feat: add opt-in Responses API mode#16
anvztor wants to merge 4 commits intoPsiACE:mainfrom
anvztor:feature/responses-mode

Conversation

@anvztor
Copy link

@anvztor anvztor commented Feb 25, 2026

  • Add use_responses flag to opt into Responses API routing (sync + async).
  • Convert chat messages to Responses input and parse Responses output for text/tool calls.
  • Add tests covering Responses handling.

Closes #15

Signed-off-by: anvztor anvztor@users.noreply.github.com

@anvztor anvztor closed this Feb 25, 2026
@anvztor anvztor reopened this Feb 26, 2026
@anvztor
Copy link
Author

anvztor commented Feb 26, 2026

Test Results (Proof)

Unit test (focused)

$ uv --directory vendor/republic run pytest -q tests/test_responses_handling.py
...                                                                      [100%]
3 passed in 0.01s

Unit test (full suite)

$ uv --directory vendor/republic run pytest -q
.......................................                                  [100%]
39 passed in 0.04s

E2E (Bub runtime against gateway)

$ PYTHONPATH=/Users/drej/workspace/dottape-internet/vendor/republic/src \
uv --directory vendor/bub run python - <<'PY'
from pathlib import Path
import asyncio
from bub.app import build_runtime

async def main() -> None:
    with build_runtime(Path('/Users/drej/workspace/dottape-internet'), enable_scheduler=False) as runtime:
        result = await runtime.handle_input('retest-502-2', 'hi')
        print('assistant_output:', result.assistant_output)
        print('error:', result.error)

asyncio.run(main())
PY
assistant_output: Hey! What can I help you build or fix today?
error: None

E2E (direct bub chat CLI)

$ PYTHONPATH=/Users/drej/workspace/dottape-internet/vendor/republic/src \
uv --directory vendor/bub run bub run "hi" --workspace /Users/drej/workspace/dottape-internet --session-id e2e-direct-2
2026-02-26 12:31:14.838 | INFO   | bub.cli.app:run:127 | - | run.start workspace=/Users/drej/workspace/dottape-internet model=<default> max_tokens=<default> allowed_tools=<all> allowed_skills=<all>
2026-02-26 12:31:14.884 | INFO   | bub.core.model_runner:run:89 | bub:28f26a959d652297__64846f03 | model.runner.step step=1 model=openai:gpt-5.3-codex
2026-02-26 12:31:18.486 | INFO   | bub.tape.service:fork_tape:70 | - | Merged forked tape 'bub:28f26a959d652297__64846f03' back into 'bub:28f26a959d652297'
Hey! What can I help you with today?

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.

Opt-in Responses API route for Bub/Republic integrations

1 participant