@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,47 @@
1
+ task:
2
+ id: mia-socket-tui-visibility-20260902
3
+ request: Determine whether Mia hides socket-delivered AI Net messages because of an old runtime version.
4
+ status: diagnosed
5
+
6
+ evidence:
7
+ remote:
8
+ host: mia@100.95.132.58
9
+ hostname: aap-pool-hera
10
+ tmux_session: aap-agent-86
11
+ versions:
12
+ installed_ciel: 0.2.37-nightly.20260902-033557.60846f9
13
+ npm_nightly_tag: 0.2.37-nightly.20260902-033557.60846f9
14
+ active_cli: codex-cli 0.152.1
15
+ installed_claude_npm_package: 2.1.245
16
+ installed_claude_native_binary: unavailable
17
+ active_process:
18
+ ciel_pid: 220324
19
+ cli_pid: 220566
20
+ cli_kind: codex
21
+ codex_router_flag: supports_websockets=false
22
+ claude_messaging_socket_active: false
23
+ observed_ai_net_delivery:
24
+ runtime_input_id: 1241
25
+ event_id: 1788324452627-0
26
+ event_type: net.ai-net.room.mentioned
27
+ event_time_utc: 2026-09-02T04:47:32.627Z
28
+ receiver: default
29
+ transport: sse
30
+ terminal_evidence: >-
31
+ tmux capture-pane contains the exact event between
32
+ '[ciel-runtime untrusted external event receiver=default transport=sse]'
33
+ and '[ciel-runtime end external event]'.
34
+ local_claude_control:
35
+ version: 2.1.258
36
+ frame: Ciel ClaudeSessionSocketClient user frame without from
37
+ result: >-
38
+ The live TUI rendered a Held peer message notice and the exact probe body;
39
+ socket input was not inherently invisible.
40
+
41
+ conclusion:
42
+ version_mismatch_caused_mia_visibility: false
43
+ details: >-
44
+ Mia runs the current Ciel nightly and its active session is Codex, so Claude
45
+ cross-session socket rendering is not involved. AI Net SSE input has been
46
+ observed in the active Codex pane. A separate AI Net listener owned by
47
+ kevin-codex launches 'claude -p --continue' out of band and is not Mia's TUI.
@@ -0,0 +1,108 @@
1
+ task:
2
+ id: cielarvis-qwen38-token-plan-latency-20260902
3
+ request: >-
4
+ Diagnose whether the nearly stalled Qwen3.8-Max run in C:/Users/djlov/cielarvis
5
+ is caused by Ciel parameter projection or by the Singapore service.
6
+ status: diagnosed
7
+ mutations_to_live_session: none
8
+
9
+ runtime_identity:
10
+ workspace: C:/Users/djlov/cielarvis
11
+ workspace_id: a3a719fc6552
12
+ router: http://127.0.0.1:9469
13
+ router_pid: 93732
14
+ codex_pid: 96776
15
+ provider: alitoken
16
+ upstream_base_url: https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
17
+ model: qwen3.8-max
18
+ protocol: openai_responses
19
+ note: >-
20
+ The configured endpoint is Alibaba Token Plan, not the separately isolated
21
+ Coding Plan endpoint at https://coding-intl.dashscope.aliyuncs.com/v1.
22
+
23
+ confirmed_findings:
24
+ process_health:
25
+ router_responding: true
26
+ codex_responding: true
27
+ router_working_set_mb: 125.3
28
+ codex_working_set_mb: 264.9
29
+ qwen_request_errors_after_launch: 0
30
+ completed_requests_returned_http_200: true
31
+ effort_projection:
32
+ workspace_config_effort: xhigh
33
+ codex_turn_effort: high
34
+ launch_catalog_default: xhigh
35
+ launch_catalog_supported: [low, medium, xhigh]
36
+ live_router_started_at: 2026-09-02T10:55:03-05:00
37
+ updated_runtime_installed_at: 2026-09-02T11:02:29-05:00
38
+ live_projection: high_to_xhigh
39
+ evidence: >-
40
+ The launch-time implementation normalized Qwen3.8 Responses effort with
41
+ _normalize_qwen38_effort, whose documented mapping sends high to xhigh.
42
+ The already-running Python process predates the later local deployment.
43
+ live_workload:
44
+ resumed_session_file_mb: 68.06
45
+ latest_input_tokens: 99803
46
+ latest_cache_read_tokens: 8192
47
+ latest_uncached_input_tokens: 91611
48
+ wire_payload_before_compaction_bytes: 20681971
49
+ wire_payload_after_compaction_bytes: 8409549
50
+ note: >-
51
+ The resumed session repeatedly sends a large context. Cache reuse varies;
52
+ the latest observed call had only 8,192 cached tokens.
53
+ observed_upstream_phase:
54
+ matched_requests: 47
55
+ average_seconds: 64.7
56
+ minimum_seconds: 16
57
+ maximum_seconds: 197
58
+ examples:
59
+ - {seconds: 197, input_tokens: 182055, output_tokens: 6587, reasoning_tokens: 5888}
60
+ - {seconds: 180, input_tokens: 88987, output_tokens: 6658, reasoning_tokens: 6222}
61
+ - {seconds: 20, input_tokens: 93151, output_tokens: 86, reasoning_tokens: 17}
62
+ - {seconds: 16, input_tokens: 92404, output_tokens: 76, reasoning_tokens: 7}
63
+ interpretation: >-
64
+ Longer completed calls coincide with thousands of reasoning tokens. Even
65
+ short-output calls retain a 16-20 second floor at roughly 92K input tokens.
66
+ controlled_same_endpoint_probe:
67
+ prompt: Reply with exactly OK.
68
+ max_output_tokens: 32
69
+ results:
70
+ none: {seconds: 3.07, status: completed, input_tokens: 212, output_tokens: 2, reasoning_tokens: 0}
71
+ low: {seconds: 2.30, status: completed, input_tokens: 236, output_tokens: 23, reasoning_tokens: 18}
72
+ high: {seconds: 2.35, status: completed, input_tokens: 248, output_tokens: 29, reasoning_tokens: 25}
73
+ xhigh: {seconds: 2.32, status: completed, input_tokens: 248, output_tokens: 24, reasoning_tokens: 21}
74
+ conclusion: >-
75
+ The Singapore Token Plan endpoint was responsive for small requests during
76
+ the incident; the measurements do not support a general endpoint outage.
77
+
78
+ official_evidence:
79
+ token_plan_quick_start:
80
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/token-plan-personal-quick-start
81
+ base_url: https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
82
+ responses_api:
83
+ url: https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-responses
84
+ default_effort: xhigh
85
+ supported_efforts: [none, minimal, low, medium, high, xhigh, max]
86
+ documented_effect: Lower effort accelerates responses and reduces inference tokens.
87
+ chat_api:
88
+ url: https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions
89
+ high_mapping: xhigh
90
+ xhigh_thinking_budget: 262144
91
+
92
+ diagnosis:
93
+ general_singapore_service_outage_supported: false
94
+ parameter_contribution_supported: true
95
+ workload_contribution_supported: true
96
+ conclusion: >-
97
+ The observed delay is dominated by the old resumed session's large, often
98
+ mostly uncached context plus high being projected to xhigh reasoning. Alibaba
99
+ performs the slow upstream phase, but the endpoint itself is not generally
100
+ slow for small requests. Current logs do not expose queue time versus model
101
+ inference time, so that finer split remains unmeasured.
102
+
103
+ evidence_locations:
104
+ config: C:/Users/djlov/AppData/Roaming/ciel-runtime/workspaces/a3a719fc6552/config.json
105
+ router_log: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9469-a3a719fc6552/router.log
106
+ router_activity: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9469-a3a719fc6552/router-activity.json
107
+ codex_session: C:/Users/djlov/.codex/sessions/2026/08/20/rollout-2026-08-20T02-08-27-01a01dff-f0f0-7ef3-8cde-1d9916510f35.jsonl
108
+ credentials_recorded: false
@@ -0,0 +1,92 @@
1
+ task:
2
+ id: cielarvis-qwen38-vs-gpt56-latency-20260902
3
+ request: >-
4
+ Compare Qwen3.8-Max Singapore Token Plan latency with GPT-5.6-sol in the
5
+ same C:/Users/djlov/cielarvis Codex session and determine whether the
6
+ observed performance is abnormally slower despite the 1M context capacity.
7
+ status: diagnosed
8
+
9
+ comparison_scope:
10
+ workspace: C:/Users/djlov/cielarvis
11
+ codex_session: 01a01dff-f0f0-7ef3-8cde-1d9916510f35
12
+ date: 2026-09-02
13
+ comparable_input_range_tokens: [60000, 110000]
14
+ qwen_sample_count: 47
15
+ gpt_sample_count: 55
16
+ credentials_recorded: false
17
+
18
+ measurements:
19
+ qwen3_8_max:
20
+ provider: alitoken
21
+ median_seconds: 28
22
+ average_seconds: 56.5
23
+ p90_seconds: 120
24
+ average_input_tokens: 81547
25
+ average_cached_input_tokens: 23271
26
+ average_uncached_input_tokens: 58276
27
+ cache_hit_percent: 28.5
28
+ average_output_tokens: 1530
29
+ average_reasoning_tokens: 1302
30
+ timing_source: >-
31
+ Exact router interval from provider_responses_wire_compact completion to
32
+ the matching POST /v1/responses HTTP 200 completion.
33
+ gpt_5_6_sol:
34
+ provider: codex
35
+ median_seconds: 3.0
36
+ average_seconds: 3.7
37
+ p90_seconds: 6.1
38
+ average_input_tokens: 83959
39
+ average_cached_input_tokens: 81310
40
+ average_uncached_input_tokens: 2649
41
+ cache_hit_percent: 96.8
42
+ average_output_tokens: 374
43
+ average_reasoning_tokens: 158
44
+ timing_source: >-
45
+ Inferred request interval from the preceding Codex token-count boundary
46
+ to the matching POST /backend-api/codex/responses HTTP 200 completion.
47
+
48
+ ratios:
49
+ qwen_to_gpt_median_latency: 9.3
50
+ qwen_to_gpt_average_latency: 15.3
51
+ qwen_to_gpt_reasoning_tokens: 8.2
52
+ qwen_to_gpt_output_tokens: 4.1
53
+ qwen_to_gpt_uncached_input_tokens: 22.0
54
+
55
+ additional_checks:
56
+ qwen_small_prompt_same_endpoint:
57
+ input_tokens_range: [212, 248]
58
+ response_seconds_range: [2.30, 3.07]
59
+ result: completed
60
+ parallel_alitoken_session:
61
+ workspace: G:/OneCielDMSUI
62
+ last_activity: 2026-09-02T10:57:24-05:00
63
+ sustained_overlap_with_comparison_window: false
64
+ qwen_errors:
65
+ http_429: 0
66
+ timeout: 0
67
+ completed_status: http_200
68
+
69
+ official_evidence:
70
+ qwen_responses_api:
71
+ url: https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-responses
72
+ fact: >-
73
+ A 1M context value is an accepted-capacity limit. The documentation says
74
+ lower reasoning effort accelerates responses and reduces inference tokens.
75
+ token_plan_faq:
76
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/token-plan-personal-faq
77
+ facts:
78
+ - Peak-hour queuing can occur for Personal Edition.
79
+ - Exact TPM, TPS, and RPM thresholds are dynamically adjusted and not public.
80
+ - Trimming context is the documented performance optimization.
81
+
82
+ diagnosis:
83
+ objectively_slower_than_gpt_5_6_sol: true
84
+ one_million_context_implies_low_latency: false
85
+ confirmed_contributors:
86
+ - Qwen reused only 28.5 percent of comparable input versus GPT's 96.8 percent.
87
+ - Qwen generated 8.2 times more reasoning tokens per comparable request.
88
+ - The running pre-update router maps the Codex high effort to Qwen xhigh.
89
+ unresolved_split: >-
90
+ Current router logs measure the total Alibaba upstream phase but do not
91
+ expose time-to-first-token, provider queue time, and model inference time
92
+ separately. Peak-hour queue contribution therefore remains unmeasured.
@@ -0,0 +1,85 @@
1
+ task:
2
+ id: anthropic-context-one-million-defaults-20260902
3
+ request: >-
4
+ Correct Claude model defaults so routed Claude Code sessions use the 1M
5
+ context variant only when the Claude-facing model id carries [1m].
6
+ status: verified
7
+
8
+ official_evidence:
9
+ model_overview:
10
+ url: https://platform.claude.com/docs/en/models/overview
11
+ observed:
12
+ - Claude Fable 5.1, Fable 5, Opus 5, and Sonnet 5 list 1M context.
13
+ - Claude Haiku 4.5 lists 200K context.
14
+ claude_code_model_configuration:
15
+ url: https://code.claude.com/docs/en/model-config
16
+ observed:
17
+ - Gateway deployments use the [1m] model suffix to select extended context.
18
+ - The suffix can be appended to aliases or full model names.
19
+
20
+ local_evidence:
21
+ before:
22
+ claude_cli_version: 2.1.258
23
+ target_workspace: C:/Users/djlov/cielarvis/mind-core-sand-box
24
+ configured_model: claude-opus-5
25
+ launched_model: ciel-runtime-anthropic-claude-opus-5
26
+ displayed_context_tokens: 200000
27
+ normalization_probe:
28
+ input: claude-opus-5[1m]
29
+ output: claude-opus-5
30
+ after:
31
+ migrated_model: claude-opus-5[1m]
32
+ normalized_model: claude-opus-5[1m]
33
+ upstream_wire_model: claude-opus-5
34
+ claude_facing_model: ciel-runtime-anthropic-claude-opus-5[1m]
35
+ max_context_environment: 1048576
36
+ auto_compact_environment: 1000000
37
+ claude_tui_header: Opus 5 (1M context) with xhigh effort
38
+
39
+ implementation:
40
+ identity:
41
+ - Preserve [1m] in Anthropic configuration and Claude-facing aliases.
42
+ - Remove [1m] only at the upstream Anthropic API boundary.
43
+ defaults:
44
+ current_model: claude-opus-5[1m]
45
+ one_million_variants:
46
+ - claude-fable-5-1[1m]
47
+ - claude-fable-5[1m]
48
+ - claude-opus-5[1m]
49
+ - claude-opus-4-8[1m]
50
+ - claude-sonnet-5[1m]
51
+ - claude-sonnet-4-6[1m]
52
+ migration:
53
+ marker: anthropic_default_1m_model_ids_20260902
54
+ behavior: >-
55
+ Add the 1M variants and migrate current models whose official default is
56
+ 1M. Keep opt-in Sonnet 4.6 and Haiku 4.5 unchanged.
57
+
58
+ verification:
59
+ focused:
60
+ total: 129
61
+ result: passed
62
+ suites:
63
+ - test_provider_contract_matrix.py
64
+ - test_anthropic_native_output_tokens.py
65
+ - test_codex_runtime.py
66
+ full:
67
+ command: npm test
68
+ unit: {total: 1358, skipped: 45}
69
+ router: {total: 1069, skipped: 0}
70
+ channel: {total: 403, skipped: 80}
71
+ runtime: {total: 258, skipped: 12}
72
+ result: passed
73
+ runtime_probe:
74
+ request_sent: false
75
+ result: Claude Code rendered Opus 5 (1M context) in the target workspace.
76
+ local_deployment:
77
+ command: .\\install.ps1
78
+ target: C:/Users/djlov/.local/share/ciel-runtime
79
+ version: 0.2.37
80
+ source_installed_hashes_match: true
81
+ installed_workspace_projection:
82
+ configured_model: claude-opus-5[1m]
83
+ claude_facing_model: ciel-runtime-anthropic-claude-opus-5[1m]
84
+ max_context_environment: 1048576
85
+ auto_compact_environment: 1000000
@@ -0,0 +1,104 @@
1
+ task:
2
+ id: qwen38-cache-hit-improvement-20260902
3
+ request: >-
4
+ Continue from cache research through implementation and verified
5
+ improvement for Codex using Alibaba Singapore Token Plan alitoken.
6
+ status: verified
7
+
8
+ implementation:
9
+ stateless_cache_policy:
10
+ source: ciel_runtime_support/provider_responses_passthrough.py
11
+ behavior: >-
12
+ When an alitoken Responses request has no previous_response_id, remove
13
+ x-dashscope-session-cache from the final upstream headers. This leaves
14
+ qwen3.8-max on Alibaba's automatic implicit prefix cache. Preserve the
15
+ configured header when a linked previous_response_id is present.
16
+ provider_default:
17
+ responses_session_cache_requires_previous_response_id: true
18
+ prefix_stable_compaction:
19
+ source: ciel_runtime_support/prompt_compaction.py
20
+ behavior: >-
21
+ Round the omitted-history boundary forward to a deterministic 24-item
22
+ checkpoint, then advance only as needed to avoid orphaning a function
23
+ output from its call. Appended turns reuse the same summary until the
24
+ next checkpoint instead of rewriting item zero on every sliding step.
25
+ provider_default:
26
+ responses_cache_checkpoint_items: 24
27
+ scope:
28
+ enabled_provider: alitoken
29
+ other_provider_defaults_changed: false
30
+
31
+ live_verification:
32
+ method: >-
33
+ Forked an existing inactive Codex history into a new session and ran it
34
+ through source-built Ciel Runtime on isolated port 9490. The production
35
+ router on port 9479 was not stopped or reconfigured.
36
+ workspace: C:/Users/djlov/ciel-runtime/.tmp/cache-hit-live-verify
37
+ session_id: 01a0637b-6c5c-70d3-a419-c10ed1854cc2
38
+ provider: alitoken
39
+ model: qwen3.8-max
40
+ protocol: openai_responses
41
+ before_stateless_policy:
42
+ header: {x-dashscope-session-cache: enable}
43
+ calls:
44
+ - {input_tokens: 115314, cached_input_tokens: 0, hit_percent: 0.000}
45
+ - {input_tokens: 115565, cached_input_tokens: 0, hit_percent: 0.000}
46
+ weighted_hit_percent: 0.000
47
+ after_stateless_policy:
48
+ header: deferred_missing_previous_response_id
49
+ calls:
50
+ - {phase: implicit_warmup, input_tokens: 115604, cached_input_tokens: 1024, hit_percent: 0.886}
51
+ - {phase: warmed, input_tokens: 115643, cached_input_tokens: 115072, hit_percent: 99.506}
52
+ - {phase: repeated_warmed, input_tokens: 115682, cached_input_tokens: 115072, hit_percent: 99.473}
53
+ warmed_calls_weighted_hit_percent: 99.489
54
+ upstream_evidence:
55
+ activity_file: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9490-8b364f9629ac/router-activity.json
56
+ log_file: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9490-8b364f9629ac/router.log
57
+ observed_log_marker: provider_responses_session_cache_deferred provider=alitoken reason=missing_previous_response_id
58
+
59
+ prefix_verification:
60
+ input_change: 633_to_636_items
61
+ budget_tokens: 2240633
62
+ first_compacted_items: 274
63
+ second_compacted_items: 277
64
+ first_wire_bytes: 8220013
65
+ second_wire_bytes: 8310319
66
+ common_prefix_bytes: 8220011
67
+ common_prefix_percent_of_first: 99.999976
68
+ first_summary_equal: true
69
+
70
+ automated_verification:
71
+ full_suite:
72
+ command: npm test
73
+ result: passed
74
+ groups:
75
+ - {name: unit, tests: 1361, skipped: 45}
76
+ - {name: router, tests: 1076, skipped: 0}
77
+ - {name: channel, tests: 403, skipped: 80}
78
+ - {name: runtime, tests: 258, skipped: 12}
79
+ total_tests: 3098
80
+ lint:
81
+ command: npm run lint
82
+ result: passed
83
+ screenshot:
84
+ path: C:/Users/djlov/ciel-runtime/docs/journal/2026/09/02/implementation/cache/alibaba/qwen38-cache-hit-improvement.png
85
+ visible_fact: isolated router 9490 reported upstream success for alitoken qwen3.8-max
86
+
87
+ cleanup:
88
+ isolated_router_9490_reachable_after_stop: false
89
+ production_router_9479_reachable_after_cleanup: true
90
+ production_router_restarted: false
91
+ production_session_interrupted: false
92
+
93
+ evidence_boundaries:
94
+ confirmed:
95
+ - Two warmed implicit-cache calls reported more than 99.47 percent cached input.
96
+ - The same isolated session's preceding two forced-session-cache calls reported zero cached input.
97
+ - Checkpointed compaction preserved 99.999976 percent of the first serialized wire in the representative oversized case.
98
+ not_claimed:
99
+ - Alibaba documents that implicit cache hits are not guaranteed, so every future request is not guaranteed to hit.
100
+ - The live session did not exceed the ten-MiB wire limit; it verifies the header policy but not live upstream behavior after checkpoint compaction.
101
+ - Server scheduling is not observable, so the A/B sequence is evidence of improvement, not proof that every difference has one exclusive cause.
102
+ - previous_response_id stateful continuation was not implemented in this change.
103
+
104
+ credentials_recorded: false
@@ -0,0 +1,97 @@
1
+ task:
2
+ id: alibaba-responses-session-cache-20260902
3
+ request: >-
4
+ Fix the Qwen3.8-Max Responses reasoning-effort projection bug, identify the
5
+ measured cache miss cause, and increase cache reuse for Alibaba Singapore
6
+ Token Plan Codex sessions.
7
+ status: implemented_and_live_verified
8
+
9
+ confirmed_problem:
10
+ workspace: C:/Users/djlov/cielarvis
11
+ provider: alitoken
12
+ model: qwen3.8-max
13
+ protocol: openai_responses
14
+ old_live_router_port: 9469
15
+ observations:
16
+ - latest old-session input was approximately 100K tokens with only 8,192 cached tokens
17
+ - repeated request bodies were compacted below the service's 10 MiB wire limit
18
+ - exact reconstructed consecutive compacted inputs retained a 7,966,060-byte common prefix
19
+ - Ciel did not send x-dashscope-session-cache before this change
20
+ correction: >-
21
+ The initial hypothesis that deterministic wire compaction changed the first
22
+ input item on every request was contradicted by exact reconstruction of the
23
+ latest consecutive inputs. The compressed prefix was stable in that range.
24
+ The missing session-cache opt-in header is the confirmed persistent cause.
25
+
26
+ official_contract:
27
+ responses_api:
28
+ url: https://www.alibabacloud.com/help/en/model-studio/compatibility-with-openai-responses-api
29
+ header: x-dashscope-session-cache
30
+ enabled_value: enable
31
+ default_value: disable
32
+ context_cache:
33
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/context-cache
34
+ prefix_requirement_tokens: 1024
35
+ placement_rule: repeated content first and unique content last
36
+
37
+ implementation:
38
+ provider_defaults:
39
+ providers: [alims-intl, alitoken, alitoken-individual]
40
+ protocol: openai_responses
41
+ header: {x-dashscope-session-cache: enable}
42
+ generic_header_projection:
43
+ source: ciel_runtime_support/provider_request_access.py
44
+ safety_exclusions:
45
+ - credentials and API keys
46
+ - cookies
47
+ - host and content-length
48
+ - hop-by-hop headers
49
+ - x-ciel-runtime internal headers
50
+ effort_fix:
51
+ source: ciel_runtime_support/providers/alibaba.py
52
+ responses_values_preserved: [none, minimal, low, medium, high, xhigh, max]
53
+ chat_mapping_unchanged: true
54
+ evidence_capture:
55
+ source: ciel_runtime_support/provider_responses_passthrough.py
56
+ behavior: upstream dump metadata records sanitized final header names and values
57
+
58
+ verification:
59
+ focused_unit_tests:
60
+ result: 83_passed
61
+ suites:
62
+ - {file: tests/test_provider_request_access.py, tests: 12}
63
+ - {file: tests/test_responses_prompt_compaction.py, tests: 8}
64
+ - {file: tests/test_alibaba_provider.py, tests: 42}
65
+ - {file: tests/test_meta_provider.py, tests: 21}
66
+ isolated_live_router:
67
+ workspace: C:/Users/djlov/cielarvis
68
+ port: 9479
69
+ production_router_modified: false
70
+ stopped_after_test: true
71
+ stopped_port_state: closed
72
+ upstream_wire:
73
+ request_1_body_bytes: 225933
74
+ request_2_body_bytes: 226262
75
+ endpoint: https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/responses
76
+ session_cache_header_request_1: enable
77
+ session_cache_header_request_2: enable
78
+ provider_reported_second_request_usage:
79
+ input_tokens: 53934
80
+ cached_tokens: 53895
81
+ uncached_tokens: 39
82
+ cache_hit_percent: 99.9277
83
+ full_project_checks:
84
+ compileall: passed
85
+ unit: {tests: 1358, skipped: 45, result: passed}
86
+ router: {tests: 1074, result: passed}
87
+ channel: {tests: 403, skipped: 80, result: passed}
88
+ runtime: {tests: 258, skipped: 12, result: passed}
89
+ ruff: passed
90
+ documentation_metadata: passed
91
+ npm_pack_dry_run: passed
92
+ credentials_recorded: false
93
+
94
+ evidence_locations:
95
+ sanitized_upstream_metadata: C:/Users/djlov/AppData/Roaming/ciel-runtime/verification/qwen-cache-20260902
96
+ isolated_router_activity: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9479-a3a719fc6552/router-activity.json
97
+ old_router_log: C:/Users/djlov/AppData/Roaming/ciel-runtime/router-instances/9469-a3a719fc6552/router.log
@@ -0,0 +1,97 @@
1
+ task:
2
+ id: alibaba-qwen38-0902-parameter-alignment-20260902
3
+ request: >-
4
+ Verify the updated Qwen3.8-Max version across Singapore Token Plan and
5
+ other Alibaba providers, then align model parameters with official docs.
6
+ status: verified
7
+
8
+ official_evidence:
9
+ model_page:
10
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/qwen3-8-max
11
+ context_window: 1000000
12
+ max_input: 991808
13
+ thinking_max_input: 983616
14
+ max_output: 131072
15
+ max_reasoning: 262144
16
+ responses_api:
17
+ url: https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-responses
18
+ efforts: [none, minimal, low, medium, high, xhigh, max]
19
+ default_effort: xhigh
20
+ singapore_supports: [xhigh, max]
21
+ conflict_rule: reasoning.effort takes precedence over enable_thinking
22
+ chat_api:
23
+ url: https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions
24
+ native_efforts: [low, medium, xhigh]
25
+ mappings: {minimal: low, high: xhigh, max: xhigh, none: enable_thinking_false}
26
+ mutual_exclusion: reasoning_effort and thinking_budget cannot both be sent
27
+ snapshot:
28
+ documented_id: qwen3.8-max-0902
29
+ unsupported_claim_checked: qwen3.8-max-0920 was not found in official docs
30
+ token_plan:
31
+ url: https://docs.modelstudio.console.alibabacloud.com/en/model-studio/token-plan-personal-overview
32
+ supported_id: qwen3.8-max
33
+ preview_behavior: qwen3.8-max-preview routes to qwen3.8-max
34
+
35
+ live_evidence:
36
+ provider: alitoken
37
+ region: ap-southeast-1
38
+ credentials_printed: false
39
+ model_catalog:
40
+ live_count: 13
41
+ qwen_ids: [qwen3.8-max, qwen3.8-max-preview]
42
+ model_id_probes:
43
+ qwen3.8-max: {http: 200, status: completed}
44
+ qwen3.8-max-preview: {http: 200, status: completed}
45
+ qwen3.8-max-0902: {http: 404, error: MODEL_NOT_FOUND}
46
+ qwen3.8-max-0920: {http: 404, error: MODEL_NOT_FOUND}
47
+ responses_effort_probes:
48
+ accepted: [none, minimal, low, medium, high, xhigh, max]
49
+ http_status: 200
50
+ none_reasoning_tokens: 0
51
+ note: >-
52
+ The 16-token probes for thinking efforts ended incomplete by design but
53
+ proved that the endpoint accepted each distinct effort value.
54
+
55
+ implementation:
56
+ model_catalog:
57
+ alims_intl:
58
+ rolling_default: qwen3.8-max
59
+ selectable_snapshot: qwen3.8-max-0902
60
+ alitoken:
61
+ rolling_default: qwen3.8-max
62
+ snapshot_added: false
63
+ reason: live Token Plan returned MODEL_NOT_FOUND for snapshot IDs
64
+ alitoken_individual:
65
+ rolling_default: qwen3.8-max
66
+ snapshot_added: false
67
+ coding_plan:
68
+ changed: false
69
+ reason: official Coding Plan list does not include Qwen3.8-Max
70
+ parameter_projection:
71
+ responses: preserve all seven official effort levels
72
+ chat: retain documented three-level mapping
73
+ conflicting_thinking_budget_removed: true
74
+ codex_default_effort: xhigh
75
+ codex_supported_efforts: [none, minimal, low, medium, high, xhigh, max]
76
+ migration:
77
+ marker: alibaba_qwen38_0902_catalog_20260902
78
+ scope: add qwen3.8-max-0902 only to alims-intl catalogs
79
+
80
+ verification:
81
+ focused_tests:
82
+ total: 151
83
+ result: passed
84
+ full_tests:
85
+ command: npm test
86
+ unit: {total: 1358, skipped: 45}
87
+ router: {total: 1071, skipped: 0}
88
+ channel: {total: 403, skipped: 80}
89
+ runtime: {total: 258, skipped: 12}
90
+ result: passed
91
+ lint:
92
+ command: npm run lint
93
+ result: passed
94
+ local_deployment:
95
+ command: .\\install.ps1
96
+ module: C:/Users/djlov/.local/share/ciel-runtime/ciel_runtime.py
97
+ installed_projection_verified: true