@oneciel-ai/ciel-runtime 0.2.22 → 0.2.23

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 (86) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +150 -57
  3. package/ciel-runtime-stop.cmd +1 -0
  4. package/ciel-runtime.cmd +1 -0
  5. package/ciel-runtimectl.cmd +1 -0
  6. package/ciel_runtime.py +56 -53
  7. package/ciel_runtime_support/anthropic_tool_turns.py +81 -0
  8. package/ciel_runtime_support/architecture.py +17 -0
  9. package/ciel_runtime_support/channel_injection.py +113 -3
  10. package/ciel_runtime_support/channel_message_prompt.py +15 -0
  11. package/ciel_runtime_support/channel_pending_injection.py +28 -4
  12. package/ciel_runtime_support/channel_pending_poll.py +2 -0
  13. package/ciel_runtime_support/channel_terminal_context.py +6 -0
  14. package/ciel_runtime_support/channel_terminal_dispatch.py +2 -0
  15. package/ciel_runtime_support/channel_terminal_proxy.py +8 -2
  16. package/ciel_runtime_support/channel_wake_claim_repository.py +7 -0
  17. package/ciel_runtime_support/channel_wake_context.py +7 -3
  18. package/ciel_runtime_support/cli_parser.py +6 -0
  19. package/ciel_runtime_support/codex_backend_context.py +4 -0
  20. package/ciel_runtime_support/codex_turn_recovery.py +75 -12
  21. package/ciel_runtime_support/config_migrations.py +102 -10
  22. package/ciel_runtime_support/config_repository.py +9 -0
  23. package/ciel_runtime_support/event_settings_cli.py +284 -2
  24. package/ciel_runtime_support/openai_chat_passthrough.py +2 -0
  25. package/ciel_runtime_support/protocols/openai_responses.py +22 -18
  26. package/ciel_runtime_support/provider_adapters.py +7 -0
  27. package/ciel_runtime_support/provider_policy.py +10 -1
  28. package/ciel_runtime_support/provider_request_builder.py +9 -2
  29. package/ciel_runtime_support/provider_responses_passthrough.py +4 -0
  30. package/ciel_runtime_support/providers/__init__.py +2 -0
  31. package/ciel_runtime_support/providers/alibaba.py +33 -10
  32. package/ciel_runtime_support/providers/constants.py +1 -0
  33. package/ciel_runtime_support/providers/opencode.py +25 -5
  34. package/ciel_runtime_support/providers/opencode_go.py +3 -3
  35. package/ciel_runtime_support/providers/openrouter.py +76 -3
  36. package/ciel_runtime_support/providers/tabitoken.py +130 -0
  37. package/ciel_runtime_support/remote_instructions.py +20 -6
  38. package/ciel_runtime_support/remote_memory.py +515 -55
  39. package/ciel_runtime_support/responses_input_compatibility.py +14 -0
  40. package/ciel_runtime_support/router_http.py +5 -0
  41. package/ciel_runtime_support/runtime_constants.py +1 -1
  42. package/ciel_runtime_support/runtime_launch.py +9 -2
  43. package/ciel_runtime_support/runtime_paths.py +2 -0
  44. package/ciel_runtime_support/tool_side_effect_dedupe.py +7 -4
  45. package/ciel_runtime_support/transcript_delta_delivery.py +333 -0
  46. package/ciel_runtime_support/usage_events.py +45 -3
  47. package/ciel_runtime_support/usage_service.py +871 -0
  48. package/ciel_runtime_support/windows_conpty.py +108 -2
  49. package/ciel_runtime_support/workspace_mcp.py +4 -0
  50. package/docs/CLI-Reference.md +11 -0
  51. package/docs/Configuration.md +7 -2
  52. package/docs/MCP-Channels.md +7 -3
  53. package/docs/Module-Map.md +4 -0
  54. package/docs/Providers.md +32 -0
  55. package/docs/Remote-Memory.md +29 -10
  56. package/docs/Test-Suite.md +1 -0
  57. package/docs/journal/2026/08/20/kevin-wake-orphan-tool-repair.md +161 -0
  58. package/docs/journal/2026/08/20/nightly-push-local-deployment.md +59 -2
  59. package/docs/journal/2026/08/20/wing-remote-memory-replication-verification.md +107 -0
  60. package/docs/journal/2026/08/21/alibaba-singapore-qwen38-official-alignment.md +64 -0
  61. package/docs/journal/2026/08/21/codex-visible-sse-wake-submit-regression.md +85 -0
  62. package/docs/journal/2026/08/21/external-sse-wake-only-change-analysis.md +131 -0
  63. package/docs/journal/2026/08/21/hyundai-invalid-replayed-tool-name-repair.okf +88 -0
  64. package/docs/journal/2026/08/21/local-stale-temporary-runtime-pin-repair.okf +118 -0
  65. package/docs/journal/2026/08/21/transcript-compaction-external-events.okf +131 -0
  66. package/docs/journal/2026/08/21/wing-ai-net-mcp-boundary-diagnosis.okf +129 -0
  67. package/docs/journal/2026/08/21/wing-cold-start-wake-submit-repair.okf +161 -0
  68. package/docs/journal/2026/08/21/wing-powershell-memory-runaway.okf +101 -0
  69. package/docs/journal/2026/08/21/wing-repeated-reasoning-tool-turn-repair.okf +112 -0
  70. package/docs/journal/2026/08/21/wing-repeated-tool-guard-finalization.okf +81 -0
  71. package/docs/journal/2026/08/21/wing-working-directory-memory-deployment.md +110 -0
  72. package/docs/journal/2026/08/21/wing-workspace-state-memory-prompt-injection.md +88 -0
  73. package/docs/journal/2026/08/22/alibaba-singapore-dual-endpoint-wire-alignment.okf +142 -0
  74. package/docs/journal/2026/08/22/delluhiold-claude-compaction-empty-tool-name.okf +168 -0
  75. package/docs/journal/2026/08/22/remote-memory-relative-prompt-paths.okf +79 -0
  76. package/docs/journal/2026/08/22/remote-memory-root-system-prompt.okf +121 -0
  77. package/docs/journal/2026/08/23/claude-web-chat-stateless-mcp-repair.okf +97 -0
  78. package/docs/journal/2026/08/23/cross-runtime-token-usage-interfaces-research.okf +378 -0
  79. package/docs/journal/2026/08/23/main-0.2.23-readme-release.okf +81 -0
  80. package/docs/journal/2026/08/23/mia-openrouter-ox-alpha-latency-diagnosis.okf +146 -0
  81. package/docs/journal/2026/08/23/openrouter-opencode-ox-alpha-support.okf +114 -0
  82. package/docs/journal/2026/08/23/tabitoken-provider-model-catalog.okf +97 -0
  83. package/docs/journal/2026/08/23/usage-stream-snapshot-implementation.okf +134 -0
  84. package/docs/usage-observability.md +141 -0
  85. package/install.ps1 +24 -3
  86. package/package.json +2 -1
@@ -0,0 +1,81 @@
1
+ okf_version: "1.0"
2
+ knowledge:
3
+ task:
4
+ id: wing-repeated-tool-guard-finalization-20260821
5
+ date: "2026-08-21"
6
+ objective: >-
7
+ Repair the WING routed Codex turn that exposes the repeated-tool guard as
8
+ the assistant's final answer instead of completing the user's request.
9
+
10
+ evidence:
11
+ host: WING
12
+ workspace: "C:\\Users\\daniel.yun.WING"
13
+ runtime_version: "0.2.22-nightly.20260821-213321.46d0e4e"
14
+ session: "01a02639-b0aa-7530-9115-8084007b2754"
15
+ transcript: >-
16
+ C:\Users\daniel.yun.WING\.codex\sessions\2026\08\21\
17
+ rollout-2026-08-21T16-28-30-01a02639-b0aa-7530-9115-8084007b2754.jsonl
18
+ router_log: >-
19
+ C:\Users\daniel.yun.WING\AppData\Roaming\ciel-runtime\
20
+ router-instances\9140-f895679997f4\router.log
21
+ observed_sequence:
22
+ - "20:18:18 the new Korean user question was present in the transcript"
23
+ - >-
24
+ 20:18:21 the upstream reasoning correctly identified that the user asked
25
+ whether a message had arrived from Samuel
26
+ - >-
27
+ 20:18:21 and 20:18:25 the same exec_command was emitted and returned the
28
+ same HTTP 400 JSON-RPC result
29
+ - >-
30
+ 20:18:29 the third identical call was dropped with completed_repeats=2
31
+ - >-
32
+ transcript ordinals 126-129 projected the runtime guard notice as an
33
+ assistant message and immediately recorded task_complete
34
+ excluded_causes:
35
+ - "The user's new question was not missing from the Codex transcript."
36
+ - "The upstream model did not misidentify the user's requested subject."
37
+ - "The duplicate-call guard did prevent a third identical execution."
38
+ security_note: >-
39
+ The captured command arguments contained an authentication value in the
40
+ transcript. It is redacted from this journal and all reports.
41
+
42
+ confirmed_cause: >-
43
+ project_ollama_response converts the internal repeated-tool guard into a
44
+ normal assistant text block. recover_preamble_only_turn did not classify
45
+ that runtime-owned control notice as recoverable, so the Responses adapter
46
+ emitted it with end_turn and Codex committed task_complete.
47
+
48
+ correction:
49
+ status: implemented_and_locally_verified
50
+ behavior:
51
+ - >-
52
+ Recognize only the exact runtime-owned repeated-tool notice and perform
53
+ one bounded upstream continuation.
54
+ - >-
55
+ Do not replay the control notice to the model. Supply a marked internal
56
+ continuation directing it to use the existing result, choose a distinct
57
+ action, or give the concrete answer.
58
+ - >-
59
+ The internal continuation does not reset repeated-call history, so the
60
+ blocked call cannot execute again during recovery.
61
+ - >-
62
+ Accept either a distinct tool call or a visible final answer from the
63
+ recovery request.
64
+ - "No host, user, model, provider, agent, or command-specific exception."
65
+
66
+ verification:
67
+ focused:
68
+ ollama_response_projection: "49 passed"
69
+ codex_turn_recovery: "32 passed"
70
+ tool_repeat_dedupe: "10 passed"
71
+ ruff: passed
72
+ documentation_metadata: passed
73
+ git_diff_check: passed
74
+ full_test:
75
+ unit: "1121 passed, 44 skipped"
76
+ router: "906 passed"
77
+ channel: "381 passed, 80 skipped"
78
+ runtime: "252 passed, 12 skipped"
79
+ total: "2660 passed, 136 skipped"
80
+ wing_live: pending
81
+ deployment: pending
@@ -0,0 +1,110 @@
1
+ # Wing working-directory Remote Memory deployment
2
+
3
+ ## Task
4
+
5
+ Store each remotely synchronized memory tree below the runtime's actual launch
6
+ workspace, inject its verified index address into routed model instructions, and
7
+ publish/install the result as a nightly build for an end-to-end Wing check.
8
+
9
+ ## Evidence before the correction
10
+
11
+ - Wing runs Ciel from `C:\Users\daniel.yun.WING`.
12
+ - Wing configuration explicitly sets `remote_memory.directory=.ciel/memory`.
13
+ - The installed `0.2.22-nightly.20260821-072901.5e5bdec` build instead mapped
14
+ that value to its AppData workspace-state directory.
15
+ - A production-pipeline capture on Wing showed the AppData index address in
16
+ both the translated Anthropic `system` block and the first Ollama `system`
17
+ message. This proves the address was not dropped by protocol conversion; it
18
+ also proves the destination did not match the requested working-directory
19
+ placement.
20
+ - A real routed model turn nevertheless claimed that no memory index was
21
+ present. That answer contradicts the captured wire payload and is not used as
22
+ evidence that the router dropped the prompt.
23
+ - After the first working-directory nightly was installed, the real model turn
24
+ again denied seeing the pointer, searched the home tree, then found and read
25
+ `.ciel/memory/index.md`. Source inspection showed that the pointer was placed
26
+ before Codex's later developer context and Ciel's execution reminder, not at
27
+ the requested bottom of the final system text.
28
+
29
+ ## Correction
30
+
31
+ - Interpret `remote_memory.directory` relative to the resolved launch
32
+ workspace and restore `.ciel/memory` as the default.
33
+ - Permit a user-home launch workspace while retaining path traversal and
34
+ workspace-boundary checks.
35
+ - Keep synchronization metadata in the per-workspace Ciel state directory.
36
+ - Record the resolved workspace in that metadata and refuse to inject an index
37
+ when the record belongs to a different launch workspace.
38
+ - Continue removing obsolete Ciel-managed pointer blocks from native runtime
39
+ instruction files; no new `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` pointer is
40
+ created.
41
+ - During Responses-to-Anthropic conversion, remove any earlier managed pointer
42
+ and append it after all converted developer context. During OpenAI/Ollama wire
43
+ projection, move it behind execution reminders and state messages so it is
44
+ the final text in the system message.
45
+
46
+ ## Local verification
47
+
48
+ - Remote Memory suites: 17 tests passed, including loopback HTTP downloads,
49
+ overwrite behavior, home-workspace placement, cross-workspace rejection,
50
+ protocol-family injection, and Responses-to-Ollama wire projection.
51
+ - Event settings suite: 25 tests passed.
52
+ - Configuration repository suite: 7 tests passed.
53
+ - Ruff and `git diff --check` passed for the changed implementation and tests.
54
+ - The full suite passed: `Ran 2633 tests in 290.487s`,
55
+ `OK (skipped=136)`.
56
+ - `npm pack --dry-run --json` succeeded with 385 package entries and included
57
+ the changed runtime, Remote Memory implementation, documentation, tests' task
58
+ journal, and package metadata.
59
+
60
+ ## Deployment verification
61
+
62
+ - Commit `66483657e033943a8388b805c90a468d1104c83a` published as
63
+ `0.2.22-nightly.20260821-075242.6648365`; npm `gitHead` matched.
64
+ - GitHub npm publish run `32460413577` completed successfully, including its
65
+ published-tarball verification.
66
+ - Wing installed that exact version and synchronized 28 files (50,689 bytes)
67
+ to `C:\Users\daniel.yun.WING\.ciel\memory`; the index existed and its first
68
+ line was `---`.
69
+ - The first real model test only reached the correct two-line result after a
70
+ broad filesystem search. That is recorded as a failed prompt-visibility
71
+ check, not as successful instruction use.
72
+ - After correcting final-system placement, the focused Remote Memory and prompt
73
+ injection suites passed 25 tests, Ruff passed, and the second full suite
74
+ passed: `Ran 2633 tests in 292.956s`, `OK (skipped=136)`.
75
+ - Commit `21872ed694428e46d4246e4bc08389f84ae462de` published as
76
+ `0.2.22-nightly.20260821-080802.21872ed`; npm `gitHead` matched and GitHub CI
77
+ run `32461589362` completed successfully.
78
+ - Wing installed that exact version and again synchronized 28 files (50,689
79
+ bytes) below the launch workspace. The index existed and its first line was
80
+ `---`.
81
+ - A real no-search model turn still denied receiving the index address. A
82
+ loopback Ollama wire capture then measured zero Remote Memory markers and no
83
+ index path in the complete upstream JSON.
84
+ - A temporary, non-published probe of the same installed source recorded
85
+ `marker_after=True` for both the `openai_responses` injection and the later
86
+ `anthropic_messages` injection. The package and provider configuration were
87
+ restored immediately afterward.
88
+
89
+ ## Final wire truncation correction
90
+
91
+ - The measured transition is therefore: marker present after Anthropic
92
+ injection, marker absent in Ollama wire projection.
93
+ - Source inspection identifies the destructive transition in
94
+ `coalesce_ollama_system_messages`: it applies
95
+ `compact_message_text_for_prompt` to the combined Anthropic system text.
96
+ That helper has a fixed `PROMPT_MESSAGE_TEXT_LIMIT=20000`, so a pointer at the
97
+ tail of Wing's longer Codex system prompt is removed before the existing
98
+ post-projection placement helper runs.
99
+ - `move_memory_pointer_to_system_end` now accepts a verified fallback pointer.
100
+ The final Ollama and OpenAI chat projection wrappers obtain that pointer from
101
+ the current workspace state and restore it only when the managed block was
102
+ removed by an intermediate projection.
103
+ - The regression test uses a 25,000-character system instruction and verifies
104
+ that the ordinary system text is truncated while the workspace memory index
105
+ is present exactly once at the final system-message tail.
106
+ - Focused Remote Memory and prompt-injection verification passed 25 tests;
107
+ Ruff and `git diff --check` also passed. The full suite passed 2,633 tests
108
+ with 136 skips, and `npm pack --dry-run --json` reported 385 entries.
109
+ Nightly publication and a new Wing wire/model check remain required before
110
+ closure.
@@ -0,0 +1,88 @@
1
+ # Wing workspace-state Remote Memory correction
2
+
3
+ ## Task
4
+
5
+ Correct the 0.2.22 Remote Memory behavior for Wing, where the runtime launch
6
+ directory is the user's home directory and no separate project directory
7
+ exists.
8
+
9
+ ## Contradiction found
10
+
11
+ - The deployed 0.2.22 implementation rejected a launch workspace equal to the
12
+ user home.
13
+ - Wing's recorded router workspace is
14
+ `C:\Users\daniel.yun.WING`; there is no separate project checkout.
15
+ - Therefore the rejection prevented every post-deployment synchronization and
16
+ could not satisfy Wing's actual deployment model.
17
+
18
+ ## Corrected boundary
19
+
20
+ - Downloaded memory is owned by the Ciel workspace state directory, not by the
21
+ process current directory.
22
+ - The default target is `<workspace-state>/memory`.
23
+ - The saved index address is verified to resolve below that state directory
24
+ before it is exposed to a prompt.
25
+ - Routed OpenAI Responses, OpenAI Chat, and Anthropic Messages requests receive
26
+ the same managed memory-index block through the protocol-aware prompt
27
+ injector.
28
+ - No Remote Memory pointer is created in home `AGENTS.md`, `CLAUDE.md`, or
29
+ `GEMINI.md`. A block written by 0.2.22 is removed without altering other user
30
+ text.
31
+ - The legacy `.ciel/memory` directory setting maps to the new state-local
32
+ `memory` directory for upgrade compatibility.
33
+
34
+ ## Verification evidence
35
+
36
+ - `python -m unittest discover -s tests -p "test_remote_memory*.py"`
37
+ passed 15 tests, including a real loopback HTTP manifest/file download.
38
+ - `python -m unittest discover -s tests -p "test_prompt_injection.py"`
39
+ passed 8 protocol transformation tests.
40
+ - `python -m unittest discover -s tests -p "test_event_settings_cli.py"`
41
+ passed 25 configuration CLI tests.
42
+ - Remote Memory integration tests assert injection into OpenAI Responses,
43
+ OpenAI Chat, and Anthropic Messages, plus idempotence.
44
+ - The first full-suite run found seven failures: one architecture line-budget
45
+ failure and six object-identity regressions when memory was disabled. The
46
+ injector was moved to its bounded module and changed to return the original
47
+ request object when no prompt exists. Focused architecture, channel bridge,
48
+ and Codex compatibility suites then passed.
49
+ - The verbose Remote Memory integration run passed all 15 tests. Its console
50
+ output explicitly records the loopback HTTP download, home-launch/state-local
51
+ storage, three protocol-family injections, and idempotence cases as `ok`.
52
+ - The final full suite passed: `Ran 2631 tests in 294.411s`, `OK (skipped=136)`.
53
+ - Targeted Ruff validation passed after removing one unused test variable.
54
+ - `npm pack --dry-run --json` succeeded for
55
+ `@oneciel-ai/ciel-runtime@0.2.22`, reported 384 package entries, and included
56
+ the changed `ciel_runtime.py`, `remote_memory.py`, documentation, and journal.
57
+ - `git status --short` confirms the pre-existing August 20 journal changes are
58
+ still present as unstaged user changes; this task did not overwrite them.
59
+
60
+ ## Deployment state
61
+
62
+ The correction is implemented and verified in the local worktree only. No git
63
+ commit, remote push, package publish, installation, or Wing process restart was
64
+ performed by this task.
65
+
66
+ ## Wing load check after install command
67
+
68
+ - The agent screenshot reports loading `memoir` from
69
+ `C:\Users\daniel.yun.WING\AGENTS.md`; it does not report the Ciel workspace
70
+ state memory index.
71
+ - SSH inspection shows Wing still has
72
+ `0.2.22-nightly.20260821-051020.13f5d91` installed.
73
+ - The installed `remote_memory.py` has the home-rejection message and has
74
+ neither `DEFAULT_DIRECTORY = "memory"` nor
75
+ `inject_current_memory_prompt`.
76
+ - The new workspace-state `memory` directory does not exist and contains zero
77
+ files. The only state record is the stale 28-file record last written at
78
+ `2026-08-21T04:45:14.4014143Z`, with root `.ciel/memory`.
79
+ - The latest launch logs at `02:21:12` and `02:21:31` record the same user-home
80
+ rejection for Claude and Codex. No later successful memory update exists.
81
+ - Home instruction files contain zero Ciel Remote Memory pointer blocks, while
82
+ both `AGENTS.md` and `CLAUDE.md` contain the separate `memoir` content.
83
+ - The npm registry confirms the `nightly` dist-tag still points to
84
+ `0.2.22-nightly.20260821-051020.13f5d91`.
85
+
86
+ Conclusion: the newly corrected memory implementation is not deployed, and
87
+ Wing has not loaded it. Installing `@nightly` could only reinstall the old
88
+ nightly because the dist-tag has not moved.
@@ -0,0 +1,142 @@
1
+ okf_version: "1.0"
2
+ knowledge:
3
+ task:
4
+ id: alibaba-singapore-dual-endpoint-wire-alignment-20260822
5
+ date: "2026-08-22"
6
+ objective: >-
7
+ Verify the two user-supplied Alibaba Model Studio Singapore API
8
+ references and apply both OpenAI Chat and Anthropic Messages wire
9
+ contracts without inferring the protocol from shared JSON fields.
10
+
11
+ official_sources:
12
+ anthropic_messages:
13
+ console_document_id: "2980295"
14
+ public_url: >-
15
+ https://www.alibabacloud.com/help/en/doc-detail/2980295.html
16
+ verified_base_url: >-
17
+ https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
18
+ verified_request_url: >-
19
+ POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1/messages
20
+ verified_auth: >-
21
+ Model Studio API key in either x-api-key or Authorization: Bearer.
22
+ verified_request_fields:
23
+ - max_tokens is required
24
+ - thinking is an optional Anthropic Extended Thinking object
25
+ - streaming emits thinking and text content blocks
26
+ openai_chat:
27
+ console_document_id: "3016807"
28
+ public_url: >-
29
+ https://www.alibabacloud.com/help/en/doc-detail/3016807.html
30
+ verified_base_url: >-
31
+ https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
32
+ verified_request_url: >-
33
+ POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions
34
+ verified_auth: "Authorization: Bearer <Model Studio API key>"
35
+ qwen38_reasoning:
36
+ supported_efforts: [low, medium, xhigh]
37
+ documented_aliases:
38
+ max: xhigh
39
+ high: xhigh
40
+ minimal: low
41
+ none: enable_thinking_false
42
+ mutual_exclusion: >-
43
+ qwen3.8-max rejects reasoning_effort and thinking_budget when both
44
+ are present.
45
+ documented_budget_mapping:
46
+ low: 4096
47
+ medium: 16384
48
+ xhigh: 262144
49
+
50
+ pre_change_reproduction:
51
+ provider: alitoken
52
+ model: qwen3.8-max
53
+ selected_protocol: anthropic_messages
54
+ selected_base_url: >-
55
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
56
+ observed_wire_profile_thinking_policy: strip
57
+ observed_input:
58
+ max_tokens: 32768
59
+ thinking:
60
+ type: enabled
61
+ budget_tokens: 16384
62
+ observed_normalized_output:
63
+ thinking_present: false
64
+ max_tokens_present: false
65
+ max_completion_tokens: 32768
66
+ evidence_conclusion: >-
67
+ The endpoint selection was correct, but Alibaba request normalization
68
+ inferred OpenAI Chat from the shared messages field. It consequently
69
+ removed the native Anthropic thinking object and rewrote the required
70
+ Anthropic max_tokens field to the OpenAI max_completion_tokens field.
71
+
72
+ implementation:
73
+ architecture:
74
+ file: ciel_runtime_support/architecture.py
75
+ change: >-
76
+ Added a protocol-aware request-normalization hook. Existing adapters
77
+ retain their protocol-neutral behavior by default.
78
+ pipeline:
79
+ file: ciel_runtime_support/provider_policy.py
80
+ change: >-
81
+ Pass the already-resolved upstream wire protocol to provider request
82
+ normalization instead of requiring adapters to infer it from body
83
+ structure.
84
+ alibaba_provider:
85
+ file: ciel_runtime_support/providers/alibaba.py
86
+ changes:
87
+ - Mark the native Alibaba Anthropic contract as preserving Anthropic thinking.
88
+ - Preserve native Anthropic request fields and history blocks unchanged.
89
+ - Retain existing Qwen3.8 OpenAI Chat reasoning and token normalization.
90
+ compatibility_facade:
91
+ file: ciel_runtime.py
92
+ change: >-
93
+ Accept an optional MessageProtocol and project it through the provider
94
+ adapter facade without exceeding the monolith line-count ratchet.
95
+
96
+ post_change_verification:
97
+ native_anthropic_projection:
98
+ upstream_format: anthropic-messages
99
+ thinking_policy: preserve
100
+ thinking_preserved: true
101
+ historical_thinking_blocks_preserved: true
102
+ max_tokens_preserved: true
103
+ max_completion_tokens_added: false
104
+ openai_chat_projection:
105
+ reasoning_effort_medium_preserved: true
106
+ conflicting_thinking_budget_removed: true
107
+ max_tokens_projected_to_max_completion_tokens: true
108
+ automated_tests:
109
+ alibaba_provider: "34 passed"
110
+ architecture_budget: "2 passed"
111
+ unit: "1129 passed, 44 skipped"
112
+ router: "910 passed"
113
+ channel: "381 passed, 80 skipped"
114
+ runtime: "252 passed, 12 skipped"
115
+ aggregate: "2672 passed, 136 skipped"
116
+ ruff: passed
117
+ compileall: passed
118
+ diff_check: passed
119
+ live_singapore_requests:
120
+ configuration_scope: >-
121
+ Ciel workspace configuration for C:/Users/djlov/ciel-runtime; API key
122
+ presence was confirmed without printing the credential.
123
+ openai_chat:
124
+ url: >-
125
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions
126
+ status: 200
127
+ elapsed_seconds: 2.469
128
+ finish_reason: stop
129
+ response_text: "OK."
130
+ anthropic_messages:
131
+ url: >-
132
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1/messages
133
+ status: 200
134
+ elapsed_seconds: 1.562
135
+ stop_reason: end_turn
136
+ response_text: "OK."
137
+
138
+ evidence_boundary: >-
139
+ The live probes establish that both configured Singapore endpoints,
140
+ bearer authentication, qwen3.8-max, and minimal non-streaming request
141
+ shapes were accepted. They do not benchmark comparative reasoning latency
142
+ or prove behavior for unrelated Alibaba models.
@@ -0,0 +1,168 @@
1
+ okf_version: "1.0"
2
+ knowledge:
3
+ task:
4
+ id: delluhiold-claude-compaction-empty-tool-name-20260822
5
+ date: "2026-08-22"
6
+ objective: >-
7
+ Diagnose and repair the Claude /compact 400 error in the ai-net
8
+ workspace on delluhiold without attributing an unverified cause.
9
+
10
+ remote_evidence:
11
+ host: delluhiold
12
+ user: oneciel
13
+ workspace: /home/oneciel/ai-net
14
+ transcript: >-
15
+ /home/oneciel/.claude/projects/-home-oneciel-ai-net/
16
+ bd9b33a6-2be4-46ac-81bc-2bd5c5eed995.jsonl
17
+ transcript_scan:
18
+ lines: 42279
19
+ malformed_json_lines: 0
20
+ tool_use_blocks: 9005
21
+ invalid_empty_name_blocks: 3
22
+ invalid_lines:
23
+ - line: 42224
24
+ timestamp: "2026-08-22T05:21:37.787Z"
25
+ model: qwen3.8-max
26
+ tool_use_id: toolu_53d6b073b4cd405183a039cf
27
+ raw_arguments: "}"
28
+ - line: 42246
29
+ timestamp: "2026-08-22T05:36:06.176Z"
30
+ model: qwen3.8-max
31
+ tool_use_id: toolu_114f0f73eed54a8da8bda2f3
32
+ raw_arguments: ""
33
+ - line: 42248
34
+ timestamp: "2026-08-22T05:46:14.643Z"
35
+ model: qwen3.8-max
36
+ tool_use_id: toolu_0275f15ac8214d95be41982e
37
+ raw_arguments: "}"
38
+ paired_results: >-
39
+ Each invalid block is followed by a tool_result containing
40
+ "No such tool available" for the same tool_use_id.
41
+
42
+ endpoint_evidence:
43
+ configured_provider: alitoken
44
+ configured_base_url: >-
45
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
46
+ native_compat: true
47
+ resolved_claude_base_url: >-
48
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
49
+ resolved_messages_url: >-
50
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1/messages
51
+ conclusion: >-
52
+ Claude used the native Anthropic endpoint. The earlier OpenAI endpoint
53
+ attribution contradicted the provider configuration and source and was
54
+ withdrawn.
55
+
56
+ chronology:
57
+ corrupt_records_created_utc: "2026-08-22T05:21:37Z..2026-08-22T05:46:14Z"
58
+ current_nightly_installed_utc: "2026-08-22T06:06:04Z"
59
+ current_version: 0.2.22-nightly.20260822-030054.b70a228
60
+ current_output_reproduction: >-
61
+ Feeding the same empty-name Anthropic SSE block to the current runtime
62
+ emits no tool_use and downgrades the malformed tool_use stop to end_turn.
63
+ remaining_failure_before_patch: >-
64
+ The three historical invalid blocks remain in the resumed transcript and
65
+ are revalidated by compaction.
66
+
67
+ implementation:
68
+ file: ciel_runtime_support/anthropic_tool_turns.py
69
+ behavior: >-
70
+ Before provider-wire normalization, remove only assistant tool_use blocks
71
+ whose names are empty or whitespace and user tool_result blocks that
72
+ explicitly reference those invalid IDs. Preserve valid, unmatched, and
73
+ unrelated history.
74
+ pipeline: ciel_runtime_support/provider_policy.py
75
+ scope: all Anthropic Messages requests, including native Anthropic providers
76
+
77
+ verification:
78
+ focused_provider_wire_tests: "7 passed"
79
+ alibaba_provider_tests: "31 passed"
80
+ architecture_contract_tests: "261 passed, 42 skipped"
81
+ full_test_groups:
82
+ unit: "1129 passed, 44 skipped"
83
+ router: "907 passed"
84
+ channel: "381 passed, 80 skipped"
85
+ runtime: "252 passed, 12 skipped"
86
+ aggregate: "2669 passed, 136 skipped"
87
+ ruff: passed
88
+ diff_check: passed
89
+ deployment:
90
+ commit: d7d93697401503be7ac5d46c28b06339f31ec592
91
+ nightly: 0.2.22-nightly.20260822-062859.d7d9369
92
+ local_windows: verified
93
+ remote_prefix: /home/oneciel/.npm-global
94
+ remote_router_pid: 1871851
95
+ remote_router_source: >-
96
+ /home/oneciel/.npm-global/lib/node_modules/@oneciel-ai/ciel-runtime/
97
+ ciel_runtime.py
98
+ remote_provider_restored: anthropic
99
+ live_remote_request:
100
+ workspace: /home/oneciel/ai-net
101
+ provider_during_probe: alitoken
102
+ model: qwen3.8-max
103
+ input: >-
104
+ Included an assistant tool_use with name="" and its paired error
105
+ tool_result, matching the observed corrupt history shape.
106
+ status: 200
107
+ response_text: OK
108
+ router_activity_time: "2026-08-22T06:33:21Z"
109
+ router_activity_bytes: 303
110
+ evidence_boundary: >-
111
+ The original interactive Claude process had already exited before the
112
+ patched package was installed, so its /compact UI command was not rerun.
113
+ The live ai-net router and real Alibaba Anthropic endpoint accepted the
114
+ same invalid-history shape after request sanitization. The original
115
+ transcript file was not modified.
116
+
117
+ interactive_revalidation:
118
+ time_utc: "2026-08-22T06:44:07Z..2026-08-22T06:55:10Z"
119
+ prior_completion_claim_withdrawn: true
120
+ failed_launch_evidence:
121
+ executable: /usr/local/bin/ciel-runtime
122
+ installed_version: 0.2.22-nightly.20260822-063634.5223153
123
+ installed_sanitizer_sha256: >-
124
+ 792c65dc1b7dc7edfbac5eb7f032edfa5455730aac0d8c643b6ee10dd3a296c5
125
+ active_provider: anthropic
126
+ active_mode: anthropic-native
127
+ router_requests_after_0641_utc: 0
128
+ result: >-
129
+ The failing resumed Claude process bypassed the router, so the request
130
+ boundary sanitizer was not invoked. The installed file itself was the
131
+ final patched version; deployment version mismatch was not the cause.
132
+ corrected_workspace_state:
133
+ workspace: /home/oneciel/ai-net
134
+ provider: alitoken
135
+ model: qwen3.8-max
136
+ mode: ciel-runtime-router
137
+ base_url: >-
138
+ https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
139
+ actual_tty_compaction:
140
+ command: /usr/local/bin/ciel-runtime --continue
141
+ session_id: bd9b33a6-2be4-46ac-81bc-2bd5c5eed995
142
+ transcript_result: compact_boundary
143
+ trigger: manual
144
+ duration_ms: 303647
145
+ pre_tokens: 319439
146
+ post_tokens: 14108
147
+ compacted_at_utc: "2026-08-22T06:54:11.187Z"
148
+ precompact_hook: passed
149
+ postcompact_hook: passed
150
+ empty_tool_name_400_during_compaction: false
151
+ post_compaction_request:
152
+ prompt: "검증: OK라고만 답해"
153
+ upstream_model: qwen3.8-max
154
+ router_activity_time: "2026-08-22T06:55:10Z"
155
+ result: >-
156
+ The request reached the model and emitted valid named Bash tool calls;
157
+ it did not reproduce the empty-tool-name 400. The model ignored the
158
+ requested terse answer and resumed work from the compacted summary, so
159
+ the response was interrupted before further side effects and the TTY
160
+ session was exited normally.
161
+ final_state:
162
+ provider_preserved: alitoken
163
+ model_preserved: qwen3.8-max
164
+ active_test_processes: 0
165
+ router_after_exit: down
166
+ expected_next_launch: >-
167
+ The Ciel launcher starts and owns the workspace router when the user
168
+ next launches or continues Claude.
@@ -0,0 +1,79 @@
1
+ okf_version: "1.0"
2
+ knowledge:
3
+ task:
4
+ id: remote-memory-relative-prompt-paths-20260822
5
+ date: "2026-08-22"
6
+ objective: >-
7
+ Project remote-memory root and index locations into system context as
8
+ portable paths relative to the active workspace instead of machine-bound
9
+ absolute paths.
10
+
11
+ evidence:
12
+ before_change:
13
+ source: ciel_runtime_support/remote_memory.py
14
+ observed: >-
15
+ _current_memory_addresses validated the memory tree and returned
16
+ str(root) and str(path), causing Windows drive and user-profile paths to
17
+ be embedded in native instruction files and routed system context.
18
+ requested_example:
19
+ absolute_root: C:/Users/daniel.yun.WING/.ciel/memory
20
+ absolute_index: C:/Users/daniel.yun.WING/.ciel/memory/index.md
21
+
22
+ implementation:
23
+ validation: >-
24
+ The stored workspace, root, and index are still resolved to absolute
25
+ filesystem paths and rejected unless the directory and index exist below
26
+ the recorded active workspace.
27
+ projection:
28
+ root: .ciel/memory
29
+ index: .ciel/memory/index.md
30
+ format: portable POSIX-style workspace-relative path
31
+ guidance: >-
32
+ The model is explicitly told to resolve the paths from the current
33
+ workspace root before reading the index and related memory files.
34
+ configured_directory: >-
35
+ A CTR-configured directory such as agent-data/memory is preserved as
36
+ agent-data/memory and its nested index remains workspace-relative.
37
+ native_files: >-
38
+ Download-time projection and later pointer restoration both use the same
39
+ verified relative addresses, so copied CLAUDE.md, AGENTS.md, and GEMINI.md
40
+ files do not retain a source-machine user profile or drive letter.
41
+
42
+ verification:
43
+ status: passed
44
+ focused:
45
+ result: "37 tests run; all passed"
46
+ coverage:
47
+ - manifest download and native instruction projection
48
+ - protocol finalization and hard compaction
49
+ - custom memory directory projection
50
+ portability_assertions:
51
+ - "The prompt contains .ciel/memory and .ciel/memory/index.md."
52
+ - "The prompt does not contain the resolved active workspace path."
53
+ - "A custom agent-data/memory directory remains portable and relative."
54
+ full_suite:
55
+ total_run: 2691
56
+ passed: 2555
57
+ skipped_environment_dependent: 136
58
+ groups:
59
+ unit: "1148 run, 44 skipped"
60
+ router: "910 run"
61
+ channel: "381 run, 80 skipped"
62
+ runtime: "252 run, 12 skipped"
63
+ quality:
64
+ compileall: passed
65
+ ruff: passed
66
+ documentation_metadata: "passed; 22 Markdown files"
67
+ diff_check: passed
68
+ package_dry_run: "passed; 401 local entries"
69
+
70
+ deployment:
71
+ local:
72
+ status: passed
73
+ path: C:/Users/djlov/.local/share/ciel-runtime
74
+ evidence: >-
75
+ The installed remote_memory.py SHA-256 matched the tested source. An
76
+ installed-module execution projected agent-data/memory and its index,
77
+ included workspace-root guidance, and exposed no absolute workspace.
78
+ nightly:
79
+ mechanism: "git push origin HEAD:nightly triggers npm-publish.yml"