@oneciel-ai/ciel-runtime 0.2.37 → 0.2.38

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +5 -2
  3. package/ciel_runtime.py +94 -96
  4. package/ciel_runtime_support/anthropic_model_policy.py +20 -3
  5. package/ciel_runtime_support/architecture.py +5 -0
  6. package/ciel_runtime_support/channel_inflight.py +4 -4
  7. package/ciel_runtime_support/channel_injection.py +56 -1
  8. package/ciel_runtime_support/channel_mcp_tools.py +34 -0
  9. package/ciel_runtime_support/channel_message_policy.py +9 -1
  10. package/ciel_runtime_support/channel_message_prompt.py +23 -0
  11. package/ciel_runtime_support/channel_pending_injection.py +86 -32
  12. package/ciel_runtime_support/channel_pending_poll.py +6 -2
  13. package/ciel_runtime_support/channel_runtime_environment.py +0 -11
  14. package/ciel_runtime_support/channel_terminal_context.py +0 -6
  15. package/ciel_runtime_support/channel_terminal_proxy.py +3 -42
  16. package/ciel_runtime_support/channel_transcript_repository.py +16 -1
  17. package/ciel_runtime_support/channel_wake_claim_repository.py +0 -19
  18. package/ciel_runtime_support/channel_wake_context.py +6 -13
  19. package/ciel_runtime_support/channel_wake_delivery_repository.py +50 -0
  20. package/ciel_runtime_support/chat_http_controller.py +88 -5
  21. package/ciel_runtime_support/claude_environment.py +100 -3
  22. package/ciel_runtime_support/claude_launch_assembly.py +4 -0
  23. package/ciel_runtime_support/claude_session_socket.py +181 -0
  24. package/ciel_runtime_support/cli_application_context.py +18 -10
  25. package/ciel_runtime_support/cli_dispatch.py +19 -3
  26. package/ciel_runtime_support/cli_parser.py +2 -0
  27. package/ciel_runtime_support/cli_usage.py +3 -2
  28. package/ciel_runtime_support/codex_backend_context.py +8 -3
  29. package/ciel_runtime_support/codex_completion_gate.py +198 -0
  30. package/ciel_runtime_support/codex_turn_recovery.py +240 -83
  31. package/ciel_runtime_support/compatibility_protocol.py +5 -2
  32. package/ciel_runtime_support/config_migrations.py +79 -0
  33. package/ciel_runtime_support/config_repository.py +7 -0
  34. package/ciel_runtime_support/context_summary_policy.py +24 -4
  35. package/ciel_runtime_support/external_event_menu.py +107 -0
  36. package/ciel_runtime_support/external_event_receiver.py +19 -1
  37. package/ciel_runtime_support/launch_state.py +2 -0
  38. package/ciel_runtime_support/managed_tool_injection.py +33 -0
  39. package/ciel_runtime_support/muse_runtime_context.py +291 -0
  40. package/ciel_runtime_support/ollama_thinking.py +12 -26
  41. package/ciel_runtime_support/prelaunch.py +13 -0
  42. package/ciel_runtime_support/prelaunch_launch_panel.py +2 -1
  43. package/ciel_runtime_support/prompt_compaction.py +39 -0
  44. package/ciel_runtime_support/provider_files_proxy.py +248 -0
  45. package/ciel_runtime_support/provider_model_identity.py +10 -2
  46. package/ciel_runtime_support/provider_option_cli.py +1 -1
  47. package/ciel_runtime_support/provider_request_access.py +54 -1
  48. package/ciel_runtime_support/provider_responses_passthrough.py +152 -15
  49. package/ciel_runtime_support/providers/alibaba.py +34 -1
  50. package/ciel_runtime_support/providers/anthropic.py +18 -1
  51. package/ciel_runtime_support/providers/meta.py +252 -21
  52. package/ciel_runtime_support/pseudo_tool_parser.py +17 -1
  53. package/ciel_runtime_support/remote_bridge.py +4 -0
  54. package/ciel_runtime_support/remote_instructions.py +5 -0
  55. package/ciel_runtime_support/remote_memory.py +1 -1
  56. package/ciel_runtime_support/responses_cache_diagnostics.py +82 -0
  57. package/ciel_runtime_support/responses_custom_tool_bridge.py +282 -0
  58. package/ciel_runtime_support/responses_input_compatibility.py +19 -3
  59. package/ciel_runtime_support/router_http.py +301 -4
  60. package/ciel_runtime_support/router_observability_context.py +26 -0
  61. package/ciel_runtime_support/router_server_context.py +1 -0
  62. package/ciel_runtime_support/runtime_adapters.py +31 -0
  63. package/ciel_runtime_support/runtime_constants.py +23 -1
  64. package/ciel_runtime_support/runtime_input_gateway.py +85 -5
  65. package/ciel_runtime_support/runtime_input_status.py +150 -0
  66. package/ciel_runtime_support/runtime_launch.py +27 -4
  67. package/ciel_runtime_support/runtime_paths.py +1 -0
  68. package/ciel_runtime_support/speech_http_controller.py +3 -2
  69. package/ciel_runtime_support/streaming_anthropic.py +3 -0
  70. package/ciel_runtime_support/tool_call_events.py +98 -0
  71. package/ciel_runtime_support/transcript_delta_delivery.py +140 -1
  72. package/ciel_runtime_support/ui_text.py +1 -0
  73. package/ciel_runtime_support/web_search_result_events.py +130 -0
  74. package/ciel_runtime_support/web_ui.py +1 -0
  75. package/ciel_runtime_support/windows_conpty.py +92 -8
  76. package/ciel_runtime_support/workspace_mcp.py +4 -1
  77. package/ciel_runtime_support/workspace_state.py +1 -0
  78. package/docs/Configuration.md +20 -4
  79. package/docs/MCP-Channels.md +79 -6
  80. package/docs/Managed-Tool-Injection.md +25 -0
  81. package/docs/Module-Map.md +4 -0
  82. package/docs/Muse-Code.md +73 -0
  83. package/docs/Observability.md +39 -0
  84. package/docs/Providers.md +29 -2
  85. package/docs/Remote-Bridge.md +12 -0
  86. package/docs/Router.md +1 -0
  87. package/docs/journal/2026/09/01/diagnostics/anthropic/router/fable51-usage-credits.okf +70 -0
  88. package/docs/journal/2026/09/01/implementation/claude/session-socket/all-input-paths/default-delivery.okf +133 -0
  89. package/docs/journal/2026/09/01/implementation/claude/session-socket/windows-direct-input.okf +112 -0
  90. package/docs/journal/2026/09/02/diagnostics/cache/alibaba/qwen38-post-restart-hit-rate.okf +107 -0
  91. package/docs/journal/2026/09/02/diagnostics/cache/ollama-cloud/kimi-k3-codex-hit-rate.okf +91 -0
  92. package/docs/journal/2026/09/02/diagnostics/codex/tui/statusline-cache-metrics.okf +44 -0
  93. package/docs/journal/2026/09/02/diagnostics/input/transport/fallback-behavior.okf +31 -0
  94. package/docs/journal/2026/09/02/diagnostics/providers/ollama-cloud/kimi-k3-agent-turn-recovery.okf +125 -0
  95. package/docs/journal/2026/09/02/diagnostics/providers/ollama-cloud/kimi-k3-parameters.okf +128 -0
  96. package/docs/journal/2026/09/02/diagnostics/remote/mia/socket-tui-visibility.okf +47 -0
  97. package/docs/journal/2026/09/02/diagnostics/runtime/alibaba/token-plan/qwen38-latency.okf +108 -0
  98. package/docs/journal/2026/09/02/diagnostics/runtime/alibaba/token-plan/qwen38-vs-gpt56-latency.okf +92 -0
  99. package/docs/journal/2026/09/02/implementation/anthropic/context/one-million-defaults.okf +85 -0
  100. package/docs/journal/2026/09/02/implementation/cache/alibaba/qwen38-cache-hit-improvement.okf +104 -0
  101. package/docs/journal/2026/09/02/implementation/cache/alibaba/qwen38-cache-hit-improvement.png +0 -0
  102. package/docs/journal/2026/09/02/implementation/cache/alibaba/responses-session-cache.okf +97 -0
  103. package/docs/journal/2026/09/02/implementation/providers/alibaba/qwen38/0902-parameter-alignment.okf +97 -0
  104. package/docs/journal/2026/09/02/implementation/providers/meta/multimodal-tools/contributor-protocol-adoption.okf +140 -0
  105. package/docs/journal/2026/09/02/implementation/providers/meta/muse-spark-1.3-support.okf +53 -0
  106. package/docs/journal/2026/09/02/monitoring/cache/alibaba/cielarvis-qwen38-live-hit-rate.okf +858 -0
  107. package/docs/journal/2026/09/02/operations/release/main-merge-local-deploy.okf +36 -0
  108. package/docs/journal/2026/09/02/operations/release/nightly/local-cache-deployment.okf +54 -0
  109. package/docs/journal/2026/09/02/operations/release/nightly/ollama-kimi-recovery-model-audit-deployment.okf +58 -0
  110. package/docs/journal/2026/09/02/operations/release/nightly/qwen38-cache-improvement-deployment.okf +72 -0
  111. package/docs/journal/2026/09/02/research/cache/alibaba/qwen38-hit-rate-improvement.okf +233 -0
  112. package/docs/journal/2026/09/02/research/cache/codex/provider-scope.okf +77 -0
  113. package/docs/journal/2026/09/02/research/providers/ollama-cloud/desktop-model-exhaustive-audit.okf +159 -0
  114. package/docs/journal/2026/09/03/diagnostics/providers/meta/muse-spark-contributor-cache-hit.okf +148 -0
  115. package/docs/journal/2026/09/03/diagnostics/providers/meta/muse-spark-contributor-required-schema.okf +127 -0
  116. package/docs/journal/2026/09/03/diagnostics/providers/ollama-cloud/kimi-k3-resumed-session-stall.okf +160 -0
  117. package/docs/journal/2026/09/03/diagnostics/providers/ollama-cloud/kimi-k3-substantive-dangling-action.okf +94 -0
  118. package/docs/journal/2026/09/03/diagnostics/remote/kevin/codex-gpt-early-turn-completion.okf +162 -0
  119. package/docs/journal/2026/09/03/implementation/runtimes/meta/muse-code/default-yolo.okf +40 -0
  120. package/docs/journal/2026/09/03/implementation/runtimes/meta/muse-code/native-subscription-router.okf +86 -0
  121. package/docs/journal/2026/09/03/operations/deployment/local/session-socket-default-fallback.okf +41 -0
  122. package/docs/journal/2026/09/03/research/deployment/colab/tailscale/credential-storage.okf +41 -0
  123. package/docs/journal/2026/09/03/research/providers/meta/muse-code/subscription-billing-boundary.okf +64 -0
  124. package/docs/journal/2026/09/03/research/web-chat/voice/instruction-format.okf +135 -0
  125. package/docs/journal/2026/09/04/diagnostics/claude/context/early-auto-compaction.okf +75 -0
  126. package/docs/journal/2026/09/04/diagnostics/claude/context/fable-51-status-200k.okf +54 -0
  127. package/docs/journal/2026/09/04/diagnostics/runtime/codex/responses/replayed-item-id-validation.okf +74 -0
  128. package/docs/journal/2026/09/04/diagnostics/workspaces/onecieldmsui/codex/replay-stall.okf +100 -0
  129. package/docs/journal/2026/09/04/implementation/observability/tool-calls/websocket-stream.okf +49 -0
  130. package/docs/journal/2026/09/04/implementation/web-chat/input/raw-injection.okf +42 -0
  131. package/docs/journal/2026/09/05/diagnostics/tty/claude-raw-idle-render.okf +25 -0
  132. package/docs/journal/2026/09/05/implementation/events/search-response-urls.okf +23 -0
  133. package/docs/journal/2026/09/05/implementation/tools/native-injection.okf +19 -0
  134. package/docs/journal/2026/09/05/implementation/windows/conpty/prompt-delivery-lifecycle.okf +43 -0
  135. package/docs/journal/2026/09/05/release/nightly/conpty-native-tools.okf +13 -0
  136. package/docs/journal/2026/09/05/release/nightly/search-result-urls.okf +14 -0
  137. package/docs/journal/2026/09/06/implementation/codex/inherited-web-mcp.okf +22 -0
  138. package/docs/journal/2026/09/07/integration/main/nightly-merge.okf +13 -0
  139. package/docs/journal/2026/09/07/release/stable/0.2.38.okf +10 -0
  140. package/package.json +1 -1
@@ -0,0 +1,112 @@
1
+ okf: 1
2
+ record:
3
+ title: Claude Code Windows peer-socket compatibility audit
4
+ date: 2026-09-01
5
+ supersession:
6
+ status: superseded-by-host-owned-socket-delivery
7
+ record: implementation/claude/session-socket/all-input-paths/default-delivery.okf
8
+ note: >-
9
+ The later implementation omits the peer from address and preserves Ciel's
10
+ explicit Web Chat/MCP reply contract, removing the reply-routing condition
11
+ that blocked socket-first delivery in this audit.
12
+ scope:
13
+ runtime: ciel-runtime
14
+ branch: nightly
15
+ feature:
16
+ family: external-input
17
+ transport: claude-cross-session-socket
18
+ platforms:
19
+ - windows-named-pipe
20
+ - unix-domain-socket
21
+ evidence:
22
+ official:
23
+ changelog: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
24
+ channels: https://code.claude.com/docs/en/channels
25
+ observations:
26
+ - Claude Code 2.1.239 added Windows cross-session messaging.
27
+ - Claude Code 2.1.243 requires a complete input line within 30 seconds.
28
+ - Claude Code 2.1.257 accepts gateway-supplied model descriptions.
29
+ - Claude Code 2.1.258 is the npm latest version measured for this task.
30
+ local_package:
31
+ version: 2.1.258
32
+ build_sha: b3cd543a1f6fcdf4d8fabc0f5e5538d2ee7f38e1
33
+ protocol:
34
+ peer_protocol: 1
35
+ first_line:
36
+ type: auth
37
+ credential: socket-bound peerToken
38
+ second_line:
39
+ type: user
40
+ message_role: user
41
+ framing: newline-delimited JSON
42
+ windows_path_shape: '\\.\pipe\LOCAL\cc-msg-<nonce>'
43
+ live_windows_probe:
44
+ claude_version: 2.1.258
45
+ session_name: ciel-socket-probe
46
+ node_client_result: CIEL_SOCKET_PROBE_OK
47
+ python_named_pipe_result: CIEL_PY_PIPE_OK
48
+ observed_ui_provenance: Another Claude session sent a message
49
+ semantic_probe:
50
+ result: rejected-for-web-chat
51
+ observation: Raw socket user frames are classified as ordinary peer messages.
52
+ side_effect_observed: The target attempted SendMessage to an unrelated live Claude peer.
53
+ containment: Probe sessions were stopped; the unrelated recipient held the benign probe for approval.
54
+ binary_source_evidence:
55
+ socket_user_handler: Constructs peer origin without hostInjected.
56
+ host_injected_path: Exists only for locally prepended stdin cross-session envelopes.
57
+ unknown_fields: Ignored by the socket user handler.
58
+ conclusion: The published peer socket cannot preserve Web Chat or remote-human reply semantics.
59
+ implementation:
60
+ safety:
61
+ socket_first_web_chat: not-enabled
62
+ retained_input_path: existing terminal and request-body delivery
63
+ reason: Direct peer delivery can redirect the answer through SendMessage.
64
+ catalog:
65
+ gateway_discovery_enabled: true
66
+ description_field: provider route description
67
+ subagent_model:
68
+ configured_source: provider.subagent_model
69
+ routed_alias: true
70
+ force_environment: CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1
71
+ fallback_without_configured_model: main model without force
72
+ verification:
73
+ gateway_catalog_http:
74
+ endpoint: http://127.0.0.1:6971/v1/models
75
+ status: 200
76
+ returned_models: 17
77
+ description_observed: Routed through Ciel Runtime provider 'zai-start-plan'.
78
+ claude_2_1_258_isolated_subagent:
79
+ server: local Anthropic-compatible capture server
80
+ exit_code: 0
81
+ expected_result_received: true
82
+ main_model: ciel-runtime-deepseek-deepseek-v4-pro-1m
83
+ subagent_model: ciel-runtime-deepseek-deepseek-v4-flash
84
+ request_model_order:
85
+ - ciel-runtime-deepseek-deepseek-v4-pro-1m
86
+ - ciel-runtime-deepseek-deepseek-v4-flash
87
+ - ciel-runtime-deepseek-deepseek-v4-pro-1m
88
+ - ciel-runtime-deepseek-deepseek-v4-pro-1m
89
+ external_provider_probe:
90
+ claude_version: 2.1.258
91
+ startup: succeeded
92
+ request_result: '405 code 3012: request blocked due to unusual activity'
93
+ interpretation: External account response, not used as implementation evidence.
94
+ full_repository:
95
+ compile: pass
96
+ unit:
97
+ passed: 1302
98
+ skipped: 44
99
+ router:
100
+ passed: 1061
101
+ channel:
102
+ passed: 320
103
+ skipped: 80
104
+ runtime:
105
+ passed: 246
106
+ skipped: 12
107
+ total_passed: 2929
108
+ total_skipped: 136
109
+ quality:
110
+ ruff: pass
111
+ documentation_metadata: pass
112
+ npm_pack_dry_run: pass
@@ -0,0 +1,107 @@
1
+ task:
2
+ id: qwen38-post-restart-cache-hit-rate-20260902
3
+ request: >-
4
+ Measure the Alibaba Singapore Token Plan qwen3.8-max cache hit rate after
5
+ restarting Ciel Runtime, compare it with the immediately preceding calls,
6
+ and verify whether cache hits benefit Token Plan usage.
7
+ status: measured
8
+
9
+ runtime:
10
+ workspace: C:/Users/djlov/cielarvis
11
+ router: http://127.0.0.1:9479
12
+ router_pid: 77820
13
+ router_started_at_utc: 2026-09-02T18:14:11Z
14
+ provider: alitoken
15
+ model: qwen3.8-max
16
+ protocol: openai_responses
17
+ session_id: 01a01dff-f0f0-7ef3-8cde-1d9916510f35
18
+
19
+ observations:
20
+ before_restart_last_14_calls:
21
+ input_tokens: 1932589
22
+ cached_input_tokens: 614400
23
+ uncached_input_tokens: 1318189
24
+ weighted_cache_hit_percent: 31.790
25
+ after_restart_first_5_calls:
26
+ input_tokens: 723907
27
+ cached_input_tokens: 0
28
+ uncached_input_tokens: 723907
29
+ weighted_cache_hit_percent: 0.000
30
+ calls:
31
+ - {time_utc: 2026-09-02T18:15:18.060Z, input: 142849, cached: 0}
32
+ - {time_utc: 2026-09-02T18:15:46.264Z, input: 143198, cached: 0}
33
+ - {time_utc: 2026-09-02T18:18:09.654Z, input: 145653, cached: 0}
34
+ - {time_utc: 2026-09-02T18:19:00.252Z, input: 145963, cached: 0}
35
+ - {time_utc: 2026-09-02T18:19:49.739Z, input: 146244, cached: 0}
36
+ after_restart_latest_15_calls:
37
+ measured_through_utc: 2026-09-02T18:35:53.849Z
38
+ input_tokens: 2281369
39
+ cached_input_tokens: 291885
40
+ uncached_input_tokens: 1989484
41
+ weighted_cache_hit_percent: 12.794
42
+ zero_cache_calls: 13
43
+ high_cache_calls: 2
44
+ high_cache_call_details:
45
+ - {time_utc: 2026-09-02T18:23:56.109Z, input: 146623, cached: 145647, percent: 99.334}
46
+ - {time_utc: 2026-09-02T18:26:11.480Z, input: 149785, cached: 146238, percent: 97.632}
47
+ change_percentage_points_latest_15_vs_before_14: -18.998
48
+ result: cache_hit_rate_partially_recovered_but_remained_below_pre_restart_window
49
+
50
+ configuration_and_wire_evidence:
51
+ workspace_protocol_header:
52
+ x-dashscope-session-cache: enable
53
+ projected_wire_header:
54
+ x-dashscope-session-cache: enable
55
+ codex_request_shape:
56
+ sends_full_input_history: true
57
+ previous_response_id_observed: false
58
+
59
+ official_contract:
60
+ responses_session_cache:
61
+ url: https://www.alibabacloud.com/help/en/model-studio/compatibility-with-openai-responses-api
62
+ facts:
63
+ - session cache is enabled by x-dashscope-session-cache=enable
64
+ - qwen3.8-max uses explicit cache when session cache is enabled
65
+ - the documented multi-turn flow links requests with previous_response_id
66
+ context_cache:
67
+ url: https://www.alibabacloud.com/help/en/model-studio/context-cache
68
+ facts:
69
+ - implicit cache is automatic for supported models
70
+ - cache hits are not guaranteed even with an identical prefix
71
+ - cached tokens remain a subset of input tokens in OpenAI-compatible usage
72
+ - qwen3.8-max cache discount is model-specific and must be checked in the console
73
+ token_plan:
74
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/token-plan-personal-faq
75
+ facts:
76
+ - Token Plan Credits deduction is lower for cache hits than misses
77
+ - official usage analysis is the source of truth for Credits consumption
78
+
79
+ conclusion:
80
+ confirmed: >-
81
+ The first five completed requests after restart reported zero cached tokens.
82
+ By the fifteenth request, two high-cache responses raised the weighted rate
83
+ to 12.794%, which was still 18.998 percentage points below the 31.792%
84
+ weighted rate across the immediately preceding fourteen calls.
85
+ causal_boundary: >-
86
+ The header is present and the current Codex full-history request does not
87
+ use previous_response_id. This differs from Alibaba's documented Responses
88
+ session-cache flow, but Alibaba did not return a cache-miss reason. The
89
+ header alone is therefore not recorded as the proven cause of the misses.
90
+ correction: >-
91
+ The earlier journal statement that the missing session-cache opt-in header
92
+ was the confirmed persistent cause is contradicted by this post-restart
93
+ production measurement and must not be treated as established fact.
94
+ usage_effect: >-
95
+ A successful cache hit lowers Token Plan Credits deduction, but the API's
96
+ total input_tokens value still includes cached tokens; cached tokens are
97
+ reported as a subset rather than removed from the input count.
98
+ measurement_correction: >-
99
+ The first-five-call result remains a valid time-bounded observation but is
100
+ not the final post-restart rate. This journal now includes the later fifteen-
101
+ call snapshot so the initial 0% result is not misread as persistent.
102
+
103
+ evidence:
104
+ router_activity: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9479-a3a719fc6552/router-activity.json
105
+ router_log: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9479-a3a719fc6552/router.log
106
+ codex_session: C:/Users/djlov/.codex/sessions/2026/08/20/rollout-2026-08-20T02-08-27-01a01dff-f0f0-7ef3-8cde-1d9916510f35.jsonl
107
+ credentials_recorded: false
@@ -0,0 +1,91 @@
1
+ task:
2
+ id: ollama-cloud-kimi-k3-codex-cache-observation-20260902
3
+ request: >-
4
+ Inspect the live Ollama Cloud kimi-k3 Codex sessions and determine whether
5
+ their prompt-cache hit rate is high.
6
+ observed_at: 2026-09-02T17:08:32-05:00
7
+ status: measured_client_metric_but_upstream_cache_hit_rate_not_observable
8
+
9
+ live_sessions:
10
+ - router_port: 9465
11
+ router_pid: 101436
12
+ workspace: G:/onecieldmsui
13
+ provider: ollama-cloud
14
+ model: kimi-k3
15
+ codex_session: 019fcac4-4538-7a53-91d1-565cd21a8c5e
16
+ rollout: C:/Users/djlov/.codex/sessions/2026/08/03/rollout-2026-08-03T22-14-48-019fcac4-4538-7a53-91d1-565cd21a8c5e.jsonl
17
+ completed_usage_samples:
18
+ - {timestamp: 2026-09-02T22:05:56.843Z, input_tokens: 826809, cached_input_tokens: 0, output_tokens: 354}
19
+ - {timestamp: 2026-09-02T22:06:12.900Z, input_tokens: 831304, cached_input_tokens: 0, output_tokens: 393}
20
+ aggregate: {samples: 2, input_tokens: 1658113, cached_input_tokens: 0, reported_weighted_hit_percent: 0.000}
21
+ - router_port: 9479
22
+ router_pid: 32968
23
+ workspace: C:/Users/djlov/cielarvis
24
+ provider: ollama-cloud
25
+ model: kimi-k3
26
+ codex_session: 01a01dff-f0f0-7ef3-8cde-1d9916510f35
27
+ rollout: C:/Users/djlov/.codex/sessions/2026/08/20/rollout-2026-08-20T02-08-27-01a01dff-f0f0-7ef3-8cde-1d9916510f35.jsonl
28
+ completed_usage_samples:
29
+ - {timestamp: 2026-09-02T22:06:55.315Z, input_tokens: 607328, cached_input_tokens: 0, output_tokens: 754}
30
+ - {timestamp: 2026-09-02T22:07:07.182Z, input_tokens: 610473, cached_input_tokens: 0, output_tokens: 507}
31
+ - {timestamp: 2026-09-02T22:07:23.556Z, input_tokens: 611608, cached_input_tokens: 0, output_tokens: 271}
32
+ aggregate: {samples: 3, input_tokens: 1829409, cached_input_tokens: 0, reported_weighted_hit_percent: 0.000}
33
+ combined_reported_aggregate:
34
+ samples: 5
35
+ input_tokens: 3487522
36
+ cached_input_tokens: 0
37
+ reported_weighted_hit_percent: 0.000
38
+
39
+ wire_evidence:
40
+ endpoint: https://ollama.com/api/chat
41
+ port_9465_prompt_estimates: [809165, 809265, 813789, 813876, 815525, 815606]
42
+ port_9479_prompt_estimates: [575538, 575630, 578584, 579517, 579614]
43
+ note: >-
44
+ These are Ciel request-side token estimates, not upstream cache accounting.
45
+
46
+ source_evidence:
47
+ response_decoder: ciel_runtime_support/protocols/ollama_chat.py
48
+ decoder_behavior: >-
49
+ decode_ollama_chat_response reads prompt_eval_count and eval_count only.
50
+ usage_encoder: ciel_runtime_support/protocols/ollama_chat.py
51
+ encoder_behavior: >-
52
+ encode_anthropic_message emits usage.input_tokens and usage.output_tokens;
53
+ it does not emit cache_read_input_tokens or cache_creation_input_tokens.
54
+ codex_projection: ciel_runtime_support/protocols/openai_responses.py
55
+ projection_behavior: >-
56
+ Missing Anthropic cache fields become input_tokens_details.cached_tokens=0
57
+ and cache_write_tokens=0 in the Responses result consumed by Codex.
58
+ stream_collector: ciel_runtime_support/ollama_stream_collection.py
59
+ collector_behavior: >-
60
+ The collector retains prompt_eval_count, eval_count, and total_duration but
61
+ currently does not retain prompt_eval_duration from the terminal chunk.
62
+
63
+ official_contract:
64
+ chat_api: https://docs.ollama.com/api/chat
65
+ usage_api: https://docs.ollama.com/api/usage
66
+ documented_usage_fields:
67
+ - total_duration
68
+ - load_duration
69
+ - prompt_eval_count
70
+ - prompt_eval_duration
71
+ - eval_count
72
+ - eval_duration
73
+ cache_token_field_documented: false
74
+ anthropic_compatibility: https://docs.ollama.com/api/anthropic-compatibility
75
+ anthropic_prompt_caching_documented_as_supported: false
76
+
77
+ conclusion:
78
+ confirmed:
79
+ - The five current Codex usage samples report zero cached input tokens.
80
+ - Ciel cannot receive a cache-token count from the documented Ollama chat response schema.
81
+ - Ciel therefore projects zero cached tokens to Codex for this route.
82
+ not_confirmed:
83
+ - The Ollama Cloud server actually missed its internal prefix or KV cache.
84
+ - The actual upstream cache-hit percentage is zero.
85
+ - Codex has a worse upstream cache hit rate than Claude for the same model, prompt, and endpoint.
86
+ measurement_limit: >-
87
+ The current zero-percent Codex display is an observability result, not a
88
+ validated Ollama Cloud cache-hit measurement. A same-provider Claude sample
89
+ with a cache field was not present in the active routers for comparison.
90
+
91
+ credentials_recorded: false
@@ -0,0 +1,44 @@
1
+ task:
2
+ id: codex-statusline-cache-metrics-20260902
3
+ request: >-
4
+ Determine whether Codex can display a Claude-like cache hit rate in its TUI
5
+ status line.
6
+ status: investigated
7
+
8
+ local_evidence:
9
+ installed_version: codex-cli 0.152.1
10
+ executable: C:/Users/djlov/AppData/Local/Programs/OpenAI/Codex/bin/codex.exe
11
+ existing_ciel_statusline:
12
+ source: ciel_runtime_support/statusline_script.py
13
+ cache_metrics_supported: true
14
+ integration_target: Claude Code statusLine command settings
15
+ codex_integration_present: false
16
+
17
+ official_source_evidence:
18
+ status_line_enum:
19
+ url: https://github.com/openai/codex/blob/main/codex-rs/tui/src/bottom_pane/status_line_setup.rs
20
+ available_token_items:
21
+ - used-tokens
22
+ - total-input-tokens
23
+ - total-output-tokens
24
+ - context-remaining
25
+ - context-used
26
+ - context-window-size
27
+ cached_tokens_item_present: false
28
+ cache_hit_rate_item_present: false
29
+ status_line_renderer:
30
+ url: https://github.com/openai/codex/blob/main/codex-rs/tui/src/chatwidget/status_surfaces.rs
31
+ cached_usage_render_branch_present: false
32
+ external_command_request:
33
+ url: https://github.com/openai/codex/issues/20043
34
+ state: closed_as_duplicate_feature_request
35
+ implemented_contract_confirmed: false
36
+
37
+ conclusion:
38
+ current_official_codex_support: false
39
+ statement: >-
40
+ Codex 0.152.1 can show cumulative token and context metrics through fixed
41
+ built-in status-line items, but it cannot show cached_tokens or cache hit
42
+ percentage, and it cannot attach Ciel's Claude-style external statusLine
43
+ command. Adding the metric requires an upstream Codex implementation or a
44
+ maintained Codex fork; no Ciel configuration-only implementation exists.
@@ -0,0 +1,31 @@
1
+ task:
2
+ id: input-transport-fallback-behavior-20260902
3
+ request: Determine whether unsupported session_socket input automatically changes to tty.
4
+ status: diagnosed
5
+
6
+ evidence:
7
+ advertised_allowed:
8
+ source: ciel_runtime_support/speech_http_controller.py
9
+ values: [session_socket, tty, router]
10
+ meaning: globally accepted request values, not active-runtime capabilities
11
+ omitted_transport:
12
+ source: ciel_runtime.py:_default_channel_input_transport
13
+ result: >-
14
+ session_socket only when the active runtime is Claude and the Ciel-owned
15
+ Claude socket is configured; tty otherwise.
16
+ explicit_session_socket:
17
+ sources:
18
+ - ciel_runtime_support/chat_http_controller.py:_message_modes
19
+ - ciel_runtime_support/channel_pending_injection.py:inject_pending_channel_messages
20
+ - ciel_runtime_support/claude_session_socket.py:ClaudeSessionSocketClient.send
21
+ result: >-
22
+ The request is accepted and stamped session_socket. If no socket target is
23
+ configured or submission fails, delivery is deferred and the cursor is not
24
+ advanced. No tty fallback occurs.
25
+ explicit_router:
26
+ result: no tty fallback when router transport is unavailable
27
+
28
+ conclusion:
29
+ automatic_for_omitted_transport: true
30
+ fallback_for_explicit_session_socket: false
31
+ capability_specific_allowed_list: false
@@ -0,0 +1,125 @@
1
+ task:
2
+ id: ollama-cloud-kimi-k3-agent-turn-recovery-20260902
3
+ request: >-
4
+ Diagnose Kimi K3 stopping after a progress sentence in routed Codex, compare
5
+ Ollama Desktop's official implementation, and apply the relevant behavior.
6
+ observed_at: 2026-09-02T19:05:11-05:00
7
+ status: verified_and_locally_deployed
8
+
9
+ live_failure_evidence:
10
+ workspace: G:/OneCielDMSUI
11
+ router_instance: 9465-60524a4bf5eb
12
+ codex_session: 019fcac4-4538-7a53-91d1-565cd21a8c5e
13
+ sequence:
14
+ - at: 2026-09-02T18:38:20-05:00
15
+ observed: two exec_command tool calls completed
16
+ - at: 2026-09-02T18:39:06-05:00
17
+ assistant_text: >-
18
+ 번역 계획(plan) 생성 지점과 메일함 설정 디코더, 이벤트 종류,
19
+ 미리보기 조회를 확인합니다.
20
+ tool_calls: 0
21
+ codex_event: task_complete
22
+ router_log:
23
+ first_recovery_at: 2026-09-02T18:38:59-05:00
24
+ first_recovery_reason: preamble_only
25
+ recovery_attempts_before_patch: 1
26
+ outcome: >-
27
+ The one recovery response also contained no tool call. The old code then
28
+ returned the original announcement and Codex completed the task.
29
+
30
+ official_ollama_desktop_reference:
31
+ repository: https://github.com/ollama/ollama
32
+ commit: b79067b0db7417f20108363bc22adb97f35c966a
33
+ file: app/ui/ui.go
34
+ relevant_lines:
35
+ - 952-955: buffer complete assistant tool-call state
36
+ - 959-993: run an agent pass loop
37
+ - 1017-1103: detect and execute tool calls
38
+ - 1200-1275: persist assistant content and thinking
39
+ - 1287-1293: continue while tools were executed
40
+ official_tool_loop_documentation: >-
41
+ https://github.com/ollama/ollama/blob/main/docs/capabilities/tool-calling.mdx
42
+ confirmed_difference: >-
43
+ Ollama Desktop retains the assistant response, including thinking and tool
44
+ calls, before the next pass. Ciel's internal preamble recovery retained only
45
+ visible text and discarded thinking.
46
+
47
+ root_cause:
48
+ confirmed:
49
+ - >-
50
+ Ciel bounded preamble recovery to exactly one retry. The live trace shows
51
+ that one retry was insufficient for this Kimi K3 turn.
52
+ - >-
53
+ body_with_continuation_nudge reconstructed the assistant message from text
54
+ only, dropping its thinking blocks before the recovery request.
55
+ - >-
56
+ A substantive no-tool completion returned by recovery was discarded by
57
+ the old branch because only a tool call could replace the announcement.
58
+ not_claimed:
59
+ - >-
60
+ The trace does not prove why Kimi K3 chose an announcement instead of a
61
+ tool call. GitHub Copilot's same-model behavior is a user observation; its
62
+ private request prompt was not available for direct comparison.
63
+
64
+ implementation:
65
+ file: ciel_runtime_support/codex_turn_recovery.py
66
+ changes:
67
+ - Preserve the complete assistant content block list in continuation history.
68
+ - Recognize Kimi K3 through ollama and ollama-cloud routes.
69
+ - Allow up to three bounded no-tool continuation attempts for Kimi K3.
70
+ - Accept a concrete non-retryable no-tool completion from recovery.
71
+ - Disable nested gateway retries inside the bounded recovery loop.
72
+ - Log attempt number, retryability, and returned visible character count.
73
+
74
+ verification:
75
+ focused_tests:
76
+ command: py -3.14 -m unittest tests.test_codex_turn_recovery -v
77
+ tests: 36
78
+ result: passed
79
+ related_regression_tests:
80
+ tests: 86
81
+ skipped: 12
82
+ result: passed
83
+ full_suite:
84
+ unit: {tests: 1363, skipped: 45, result: passed}
85
+ router: {tests: 1076, result: passed}
86
+ channel: {tests: 403, skipped: 80, result: passed}
87
+ runtime: {tests: 261, skipped: 12, result: passed}
88
+ total_tests: 3103
89
+ ruff:
90
+ result: passed
91
+ direct_ollama_agent_loop:
92
+ model: kimi-k3
93
+ think: low
94
+ pass_1: {tool: inspect_workspace, done_reason: stop}
95
+ pass_2: {tool: inspect_file, done_reason: stop}
96
+ pass_3: {content: DONE, done_reason: stop}
97
+ result: passed
98
+ installed_router_repeated_preamble_probe:
99
+ port: 9491
100
+ input_behavior: two progress-only responses before a required tool call
101
+ router_log:
102
+ - {attempt: 1, retryable: true, visible_chars: 20}
103
+ - {attempt: 2, tool: inspect_workspace}
104
+ http_status: 200
105
+ responses_status: completed
106
+ output_types: [message, reasoning, function_call]
107
+ result: passed
108
+ isolated_router_after_probe: stopped
109
+
110
+ local_deployment:
111
+ command: powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
112
+ result: passed
113
+ target: C:/Users/djlov/.local/share/ciel-runtime
114
+ source_installed_sha256_match: true
115
+ installed_behavior_probe:
116
+ attempts: 2
117
+ tool_recovered: true
118
+ thinking_preserved: true
119
+ nested_gateway_retries: 0
120
+ active_session_boundary: >-
121
+ Routers 9465 and 9479 were already running before deployment and retain the
122
+ old imported Python module until those sessions are restarted. They were not
123
+ interrupted by this verification.
124
+
125
+ credentials_recorded: false
@@ -0,0 +1,128 @@
1
+ task:
2
+ id: ollama-cloud-kimi-k3-parameter-verification-20260902
3
+ request: >-
4
+ Verify the parameters Ollama publishes for kimi-k3 and compare them with
5
+ the Ciel Runtime settings and request projection used by the live Codex sessions.
6
+ observed_at: 2026-09-02T18:41:26-05:00
7
+ status: verified
8
+
9
+ official_api_show:
10
+ request:
11
+ endpoint: https://ollama.com/api/show
12
+ model: kimi-k3
13
+ authenticated: true
14
+ result: success
15
+ modified_at: 2026-07-27T10:00:00-05:00
16
+ details:
17
+ parent_model: kimi-k3
18
+ family: kimi-k3
19
+ parameter_size: 2812000000000
20
+ quantization_level: MXFP4
21
+ capabilities: [vision, thinking, completion, tools]
22
+ model_info:
23
+ general.architecture: kimi-k3
24
+ general.parameter_count: 2812000000000
25
+ kimi-k3.context_length: 1048576
26
+ kimi-k3.embedding_length: 7168
27
+ parameters: null
28
+ meaning: >-
29
+ The provider did not publish fixed temperature, top_p, top_k, seed,
30
+ repeat_penalty, num_ctx, or num_predict values through /api/show.
31
+
32
+ official_model_card:
33
+ url: https://ollama.com/library/kimi-k3
34
+ variant: kimi-k3:cloud
35
+ context_tokens: 1048576
36
+ advertised_capabilities: [vision, tools, thinking, cloud]
37
+ pricing_per_million_tokens:
38
+ input_usd: 3.00
39
+ cached_input_usd: 0.30
40
+ output_usd: 15.00
41
+
42
+ official_request_contract:
43
+ ollama_chat_api: https://docs.ollama.com/api/chat
44
+ ollama_think_values: [true, false, low, medium, high, max]
45
+ kimi_vendor_source: https://github.com/MoonshotAI/Kimi-K3/blob/main/README.md
46
+ kimi_thinking_always_on: true
47
+ kimi_reasoning_effort_values: [low, high, max]
48
+ kimi_default_reasoning_effort: max
49
+ benchmark_only_sampling_values:
50
+ temperature: 1.0
51
+ top_p_single_step: 0.95
52
+ top_p_agentic: 1.0
53
+ benchmark_only_note: >-
54
+ Moonshot reports these sampling values for its published evaluations. The
55
+ README does not state that Ollama Cloud uses them as hidden defaults.
56
+
57
+ workspace_configuration:
58
+ workspaces:
59
+ - {hash: a3a719fc6552, path: C:/Users/djlov/cielarvis}
60
+ - {hash: 60524a4bf5eb, path: G:/OneCielDMSUI}
61
+ provider: ollama-cloud
62
+ current_model: kimi-k3
63
+ base_url: https://ollama.com
64
+ num_ctx: auto
65
+ num_ctx_min: 32768
66
+ num_ctx_max: 1048576
67
+ think: true
68
+ ollama_options: {}
69
+ request_timeout_ms: 300000
70
+ discovered_metadata:
71
+ model: kimi-k3
72
+ architecture: kimi-k3
73
+ capabilities: [vision, thinking, completion, tools]
74
+ thinking_levels: [low, high, max]
75
+ thinking_always_on: true
76
+
77
+ wire_projection:
78
+ required_fields:
79
+ model: kimi-k3
80
+ stream: true
81
+ messages: present
82
+ tools: present_when_client_supplies_tools
83
+ omitted_provider_owned_defaults:
84
+ - options.num_ctx
85
+ - options.num_predict
86
+ - options.temperature
87
+ - options.top_p
88
+ - options.top_k
89
+ - options.seed
90
+ - options.repeat_penalty
91
+ - keep_alive
92
+ omission_reason: >-
93
+ num_ctx is auto, output tokens and keep_alive were not explicitly selected,
94
+ and ollama_options is empty. Ciel therefore leaves those values to Ollama.
95
+ verified_reasoning_mapping:
96
+ low: {think: low}
97
+ high: {think: high}
98
+ xhigh: {think: max}
99
+ active_codex_reasoning_effort: high
100
+ active_wire_think: high
101
+
102
+ connection_evidence:
103
+ api_show_authenticated: success
104
+ router_9465:
105
+ request_started: 2026-09-02T18:33:59-05:00
106
+ request_estimated_tokens: 816014
107
+ first_responses_200: 2026-09-02T18:36:12-05:00
108
+ later_responses_200_through: 2026-09-02T18:37:48-05:00
109
+ router_9479:
110
+ request_started: 2026-09-02T18:34:15-05:00
111
+ request_estimated_tokens: 579783
112
+ first_responses_200: 2026-09-02T18:35:45-05:00
113
+ later_responses_200_through: 2026-09-02T18:38:09-05:00
114
+ upstream_error_in_examined_window: false
115
+ conclusion: >-
116
+ The provider connection and model lookup succeeded. The first observed
117
+ responses took about 133 seconds and 90 seconds respectively, so a client
118
+ could appear disconnected while waiting, but the logs do not show a
119
+ connection failure in this interval.
120
+
121
+ source_evidence:
122
+ provider_adapter: ciel_runtime_support/providers/ollama.py
123
+ thinking_policy: ciel_runtime_support/ollama_thinking.py
124
+ request_builder: ciel_runtime_support/provider_request_builder.py
125
+ wire_projection: ciel_runtime_support/ollama_wire_projection.py
126
+ context_policy: ciel_runtime_support/providers/ollama_context.py
127
+
128
+ credentials_recorded: false