aliyun-codex-bridge 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +118 -0
- package/CODEX_REPORT_v0.1.0.md +39 -0
- package/CODEX_TEST_SUITE.md +949 -0
- package/LICENSE +21 -0
- package/README.md +319 -0
- package/RELEASING.md +83 -0
- package/bin/aliyun-codex-bridge +227 -0
- package/bin/zai-codex-bridge +3 -0
- package/docs/DIFF_WITH_DIONANOS_MAIN.md +96 -0
- package/docs/guide.md +406 -0
- package/package.json +34 -0
- package/scripts/prepare-clean-release.ps1 +32 -0
- package/scripts/release-patch.js +60 -0
- package/scripts/start-aliyun-codex-bridge.vbs +68 -0
- package/scripts/test-curl.js +327 -0
- package/src/server.js +1594 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Stream tool-call bridging now extracts calls from `delta.tool_calls`, `choice.message.tool_calls`, and `choice.tool_calls` to avoid empty output-item rounds in Codex
|
|
12
|
+
- Added `status` fields (`in_progress`/`completed`) for streamed and non-streamed `function_call` output items for better Responses API compatibility
|
|
13
|
+
|
|
14
|
+
## [0.1.0] - 2026-01-20
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Separate reasoning output items with content-part events (aligns with Responses API)
|
|
18
|
+
- Usage propagation from upstream streaming chunks when available
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Output indices now follow creation order across message/reasoning/tool items
|
|
22
|
+
- response.completed now preserves tool-call items in non-streaming mode for parity with streaming
|
|
23
|
+
- response objects now inherit instructions/metadata/tool_choice/temperature/top_p from requests
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- Avoid empty message items when tool-only rounds are suppressed
|
|
27
|
+
|
|
28
|
+
## [0.1.0] - 2026-01-19
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- Raw upstream chunk logging (`LOG_STREAM_RAW`) for streaming diagnostics
|
|
32
|
+
- Output suppression toggles for tool-call rounds (`SUPPRESS_ASSISTANT_TEXT_WHEN_TOOLS`, `DEFER_OUTPUT_TEXT_UNTIL_DONE`)
|
|
33
|
+
- Auto-update on startup (checks npm latest and installs if newer; can be disabled via config)
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- De-duplicate streaming deltas when providers emit full-content chunks
|
|
37
|
+
- Only suppress assistant output_text when finish_reason is tool_calls (avoid hiding short final replies)
|
|
38
|
+
- Route suppressed tool-call round text into reasoning stream so it remains visible
|
|
39
|
+
|
|
40
|
+
## [0.1.0] - 2026-01-16
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
- Do not include function_call items in response.completed output (restore local tool execution)
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- Forward reasoning controls to upstream and accept reasoning text from alternative fields
|
|
47
|
+
|
|
48
|
+
### Docs
|
|
49
|
+
- Document reasoning passthrough and reasoning_text events
|
|
50
|
+
- Clarify that response.completed output excludes function_call items for local tool execution
|
|
51
|
+
|
|
52
|
+
### Docs
|
|
53
|
+
- Document reasoning passthrough and reasoning_text events
|
|
54
|
+
- Clarify that response.completed output excludes function_call items for local tool execution
|
|
55
|
+
|
|
56
|
+
## [0.1.0] - 2026-01-16
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
- Avoid empty output_text items in tool-only streaming responses
|
|
60
|
+
- Only emit output_text.done/content_part.done when output text exists
|
|
61
|
+
|
|
62
|
+
## [0.1.0] - 2026-01-16
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
- Handle streaming tool_calls without `index` by assigning a stable fallback index
|
|
66
|
+
- Improve tool name logging when tools define top-level `name`
|
|
67
|
+
|
|
68
|
+
## [0.1.0] - 2026-01-16
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
- Normalize `bin` path and repository URL for npm publish compatibility
|
|
72
|
+
|
|
73
|
+
## [0.1.0] - 2026-01-16
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- Auto-enable tool bridging when tool-related fields are present in the request
|
|
77
|
+
- Extra logging to surface `allowTools` and `toolsPresent` per request
|
|
78
|
+
- Debug tool summary logging (types and sample names)
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
- Correct output_index mapping for streaming tool call events
|
|
82
|
+
- Filter non-function tools to avoid upstream schema errors
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
- README guidance for MCP/tools troubleshooting and proxy startup
|
|
86
|
+
|
|
87
|
+
## [0.1.0] - 2026-01-16
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
- Replaced the README with expanded setup, usage, and troubleshooting guidance
|
|
91
|
+
- Clarified Codex provider configuration and proxy endpoint usage
|
|
92
|
+
|
|
93
|
+
## [0.1.0] - 2026-01-16
|
|
94
|
+
|
|
95
|
+
### Added
|
|
96
|
+
- Tool calling support (MCP/function calls) when `ALLOW_TOOLS=1`
|
|
97
|
+
- Bridging for `function_call_output` items to Chat `role: tool` messages
|
|
98
|
+
- Streaming support for `delta.tool_calls` with proper Responses API events
|
|
99
|
+
- Non-streaming support for `msg.tool_calls` in final response
|
|
100
|
+
- Tool call events: `response.output_item.added` (function_call), `response.function_call_arguments.delta`, `response.function_call_arguments.done`
|
|
101
|
+
- Automated tool call test in test suite
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
- `translateResponsesToChat()` now handles `type: function_call_output` items
|
|
105
|
+
- `streamChatToResponses()` now detects and emits tool call events
|
|
106
|
+
- `translateChatToResponses()` now includes `function_call` items in output array
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
- Tool responses (from MCP/function calls) are now correctly forwarded to upstream as `role: tool` messages
|
|
110
|
+
- Function call items are now properly included in `response.completed` output array
|
|
111
|
+
|
|
112
|
+
## [0.1.0] - Previous
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
- Initial release with Responses API to Chat Completions translation
|
|
116
|
+
- Streaming support with SSE
|
|
117
|
+
- Health check endpoint
|
|
118
|
+
- Zero-dependency implementation
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
=====================================
|
|
2
|
+
CODEX CLI TEST SUITE - SANITIZED REPORT
|
|
3
|
+
=====================================
|
|
4
|
+
|
|
5
|
+
Bridge Version: 0.1.0
|
|
6
|
+
Test Date: 2026-01-20
|
|
7
|
+
|
|
8
|
+
SUMMARY:
|
|
9
|
+
--------
|
|
10
|
+
Total Tests: 48
|
|
11
|
+
Passed: 44 (91.7%)
|
|
12
|
+
Failed: 2 (4.2%)
|
|
13
|
+
Skipped: 2 (4.1%)
|
|
14
|
+
|
|
15
|
+
CATEGORY BREAKDOWN:
|
|
16
|
+
-------------------
|
|
17
|
+
1. System Information: 3/3 passed
|
|
18
|
+
2. File Operations: 8/8 passed
|
|
19
|
+
3. Search & Discovery: 3/3 passed
|
|
20
|
+
4. Shell Execution: 6/6 passed
|
|
21
|
+
5. Text Processing: 6/6 passed
|
|
22
|
+
6. Web & Network: 2/2 passed
|
|
23
|
+
7. Git Operations: 2/3 passed (1 partial)
|
|
24
|
+
8. AI Capabilities: 1/3 passed (2 skipped)
|
|
25
|
+
9. Error Handling: 3/3 passed
|
|
26
|
+
10. Platform-Specific: 1/4 passed (3 skipped)
|
|
27
|
+
11. Cleanup: 0/2 failed
|
|
28
|
+
12. Package & Binary Verification: 8/8 passed
|
|
29
|
+
|
|
30
|
+
NOTES:
|
|
31
|
+
------
|
|
32
|
+
- This report is intentionally sanitized for public sharing.
|
|
33
|
+
- Local usernames, hostnames, absolute paths, hardware details, and machine-specific IDs were removed.
|
|
34
|
+
- Failures were environment-policy related (sandbox restrictions), not bridge logic regressions.
|
|
35
|
+
|
|
36
|
+
REFERENCE:
|
|
37
|
+
----------
|
|
38
|
+
- Full reproducible test matrix: `CODEX_TEST_SUITE.md`
|
|
39
|
+
- For private/internal troubleshooting, capture raw logs locally and do not commit them.
|