[codex] Port local CCB runtime repairs onto GitHub main - #1
Draft
agnitum2009 wants to merge 17 commits into
Draft
Conversation
Reapply the useful parts of the local 4e34125 repair commit onto a fresh agnitum2009/claude_codex_bridge main clone, keeping GitHub main as the authority instead of replaying the broad local snapshot. Constraint: direct cherry-pick conflicted with release v7.5.1 README, package, provider, and plan changes already present on origin/main. Rejected: force-applying the old snapshot commit | would overwrite newer GitHub main content and reintroduce broad unrelated churn. Rejected: committing runtime/cache state | /home/agnitum/ccb-git stays source-only for this port. Confidence: high Scope-risk: moderate Directive: Restart CCB after installing this source so running daemons reload Codex hook inheritance and Kimi pane fallback code. Tested: python3 -m py_compile on changed Python entrypoints and tests; pytest test/test_provider_hook_settings.py -k 'hindsight_hooks or codex_activity_hooks_and_trust_state' => 2 passed; pytest test/test_native_cli_providers.py test/test_native_cli_completion.py test/test_pane_quiet_support.py => 30 passed; scripts/hindsight health/version; git diff --check. Not-tested: full repository pytest suite, cargo tests, npm/package release flow, live CCB daemon restart.
Kimi MCP or skill registration makes Hindsight available, but it does not guarantee per-turn recall before prompt delivery or retain after reply completion. The CCB Kimi adapter already owns the ask/reply lifecycle, so bridge recall and retain there and fail open when Hindsight is absent. Constraint: Reuse the existing local Hindsight HTTP service and shared bank config; do not start Docker, run Windows executables, or create a parallel memory service. Rejected: Native Kimi hook projection only | Kimi hook transcript semantics are provider-version dependent, while CCB already has a stable submission and completion boundary. Confidence: high Scope-risk: moderate Directive: Keep Hindsight failures non-blocking for provider execution and preserve Kimi retain context when falling back to Codex Hindsight connection settings. Tested: python3 -m py_compile lib/provider_backends/kimi/execution.py lib/provider_backends/kimi/hindsight.py test/test_kimi_hindsight_bridge.py Tested: uv run --with pytest --with tomli python -m pytest test/test_kimi_hindsight_bridge.py test/test_native_cli_completion.py -k 'kimi' Tested: uv run --with pytest --with tomli python -m pytest test/test_native_cli_providers.py test/test_native_cli_completion.py test/test_pane_quiet_support.py test/test_kimi_hindsight_bridge.py Tested: uv run --with pytest --with tomli python -m pytest test/test_provider_hook_settings.py -k 'hindsight_hooks or codex_activity_hooks_and_trust_state' Tested: git diff --check Not-tested: real Kimi pane live round-trip after CCB restart
Kimi's CCB-managed Hindsight bridge is effective but invisible in the provider UI because it is not a native Kimi UserPromptSubmit hook. Add an opt-in visible hook-context wrapper so operators can audit recall injection in the pane when needed without making visual noise the production default. Constraint: Do not switch to provider-native Kimi hooks or duplicate the Hindsight service; keep the existing CCB execution-boundary bridge. Rejected: Always show hook context | It would pollute every Kimi task prompt and make normal operation noisier than necessary. Confidence: high Scope-risk: narrow Directive: Enable showHookContext only for audit/debug sessions; production defaults should stay quiet unless an operator needs visual proof. Tested: python3 -m py_compile lib/provider_backends/kimi/hindsight.py test/test_kimi_hindsight_bridge.py Tested: uv run --with pytest --with tomli python -m pytest test/test_kimi_hindsight_bridge.py test/test_native_cli_completion.py -k 'kimi' Tested: uv run --with pytest --with tomli python -m pytest test/test_native_cli_providers.py test/test_native_cli_completion.py test/test_pane_quiet_support.py test/test_kimi_hindsight_bridge.py Tested: git diff --check Not-tested: live visible hook after ccbd daemon restart; current daemon still has the old Python module loaded
Ubuntu runners can reject epoll registration for the Codex bridge FIFO with EPERM, even though select-style waiting works. Fall back from DefaultSelector to SelectSelector so the persistent FIFO reader keeps its delivery semantics across Linux environments. Constraint: PR branch was already up to date with origin/main; the blocking GitHub state was failing Ubuntu tests, not a branch-update conflict. Rejected: Changing the PR base or force-updating the branch | gh pr update-branch reported the branch already up-to-date and mergeable. Rejected: Skipping the FIFO bridge test on Linux | the runtime path is important and can be made portable with a narrow selector fallback. Confidence: high Scope-risk: narrow Directive: Keep the persistent FIFO reader open; fallback only changes readiness polling, not message framing or delivery acknowledgement. Tested: uv run --with pytest --with tomli python -m pytest test/test_codex_bridge_runtime.py test/test_bridge_fifo_persistent_reader.py test/test_install_script_sidebar.py::test_install_script_fails_when_sidebar_build_needs_missing_rust -q Tested: uv run --with pytest --with tomli python -m pytest test/ -q -m 'not provider_blackbox' => 2626 passed, 2 skipped, 21 deselected Tested: python -m compileall -q lib bin ccb Tested: git diff --check Not-tested: provider_blackbox matrix
Codex provider profile materialization must carry agent context so role memory and projection markers are refreshed before managed provider homes are reused. Archi doctor output also uses the current Hippos terminology from the upstream toolchain. Constraint: Archi role projection must follow the installed role digest and Architec v0.2.16 Hippos artifact names. Rejected: editing managed provider AGENTS.md by hand | it would fix one runtime projection without preventing recurrence. Confidence: high Scope-risk: narrow Directive: Future Codex provider profile paths must pass agent_name and projection marker paths whenever they materialize memory. Tested: uv run --with pytest --with tomli python -m pytest test/test_provider_profiles.py test/test_rolepacks.py -q -k 'materialize_codex_provider_profile_writes_project_memory_bundle or materialize_codex_home_config_writes_project_memory_bundle or materialize_codex_home_config_skips_memory_without_project_context or archi_tool_doctor or archi_tool_install_uses_global_npm_package or archi_tool_install_prefers_corrected_package_override or role_memory_is_included_before_agent_private_memory'; git diff --check; python -m py_compile provider materializer and rolepack service files Not-tested: full archi --check/full project analysis because it can depend on external llmgateway configuration and generated project artifacts.
Empty artifact-backed Kimi timeouts were being rendered with the same read-the-artifact instruction as valid reply artifacts. This records the empty artifact as diagnostics while making the visible reply say that no provider completion reply was captured. Constraint: Preserve artifact files and reply_artifact diagnostics for traceability. Rejected: Increase Kimi native turn timeout | It would keep queues blocked longer without fixing invalid completion evidence. Confidence: high Scope-risk: narrow Directive: Treat failed 0-byte forced reply artifacts as no captured receipt until diff and verification evidence are reviewed. Tested: uvx pytest test/test_v2_message_bureau_dispatcher_integration.py::test_dispatcher_describes_empty_forced_reply_artifact_as_uncaptured_reply test/test_v2_message_bureau_dispatcher_integration.py::test_dispatcher_spills_large_completion_reply_before_terminal_persistence test/test_v2_message_bureau_dispatcher_integration.py::test_dispatcher_forces_short_completion_reply_artifact test/test_v2_message_bureau_dispatcher_integration.py::test_dispatcher_callback_continuation_uses_artifact_for_large_child_reply test/test_v2_message_bureau_dispatcher_integration.py::test_dispatcher_callback_continuation_uses_forced_artifact_for_short_child_reply -q Tested: git diff --check Not-tested: full repository pytest
Make forced empty reply artifacts visible in trace payloads and CLI output, and allow Kimi native turn timeout tuning without changing the project config schema. Constraint: Kimi native turns can timeout with no captured governed receipt while still leaving workspace changes that require coordinator review. Rejected: Treating 0-byte forced artifacts as ordinary artifact replies | it hides the no-captured-receipt state from trace diagnostics. Confidence: high Scope-risk: moderate Directive: Keep empty forced artifacts as diagnostic evidence only; do not promote them to successful replies without diff and verification review. Tested: uvx pytest targeted artifact trace, CLI render, and Kimi native completion tests in /home/agnitum/ccb-git and /root/.local/share/codex-dual; git diff --check. Not-tested: full repository test suite.
Render compact Comms entries as two-line records so route/status stay on the header line and message text starts under the cancel column. Increase the default Comms share to 23%, shorten Tips to 27%, and add Tips scrolling. Preserve the rich layout alias helpers while syncing the install-source topology defaults. Constraint: current daemon can consume explicit sidebar view config without a full CCB restart; running sidebar panes keep their old process until respawned. Rejected: raw tmux respawn of live sidebar panes | no sidebar-only control-plane restart command was available, and raw tmux mutation would exceed the safe CCB config path. Confidence: high Scope-risk: moderate Directive: Keep bin/ccb-agent-sidebar as the tracked wrapper; build/install the ELF separately. Tested: cargo test --manifest-path tools/ccb-agent-sidebar/Cargo.toml --quiet; python3 -m py_compile for touched Python modules/tests; Python import/default/rich-alias smoke checks; ccb config validate; ccbd project_view socket reports sidebar 50/23/27. Not-tested: pytest suite unavailable in this environment because pytest is not installed; live sidebar panes were not raw-respawned.
Keep the CCB sidebar usable when any of the tree, Comms, or Tips sections overflow by giving each panel its own scroll state and mouse-wheel routing, and by allowing the two section dividers to be dragged within guarded minimum heights. Constraint: existing configured sidebar percentages remain the default layout source. Rejected: raw tmux/sidebar process mutation | no sidebar-only control-plane restart command is exposed, and running panes must not be respawned ad hoc. Confidence: high Scope-risk: narrow Directive: do not treat runtime drag heights as persisted config; they are per sidebar process state. Tested: cargo test --manifest-path tools/ccb-agent-sidebar/Cargo.toml --quiet; cargo build --manifest-path tools/ccb-agent-sidebar/Cargo.toml --release; cargo test --manifest-path /root/.local/share/codex-dual/tools/ccb-agent-sidebar/Cargo.toml --quiet; ccb config validate; git diff --check Not-tested: live mouse drag inside existing tmux panes, because current sidebar processes still reference the old deleted binary inode until panes are restarted.
(cherry picked from commit 7ebe680)
Resolve upstream sync conflicts by keeping upstream Hindsight token compatibility and rich tool alias structure while preserving the sidebar Comms/Tips split and resizable panel implementation. Tested: python3 -m py_compile merged conflict files; cargo test --manifest-path temp ccb-agent-sidebar/Cargo.toml --quiet
Resolve upstream conflicts by taking the latest upstream Kimi no-captured-reply evidence handling while preserving the sidebar panel scrolling and resize implementation. Tested: python3 -m py_compile merged conflict files; cargo test --manifest-path temp ccb-agent-sidebar/Cargo.toml --quiet
Generalize managed Codex home projection so deployments can keep safe local command hooks without baking Hindsight-specific paths into CCB. The default allowlist still carries Hindsight Codex hooks, while operators can extend events and command markers through environment policy. Constraint: managed provider homes must not inherit arbitrary root hooks or credentials. Rejected: copy all Codex hooks wholesale | would let unmanaged root hooks run inside CCB agents. Confidence: high Scope-risk: narrow Directive: keep default inherited command hooks fail-closed and marker-based; extend through policy knobs, not broad trust. Tested: uvx pytest -q test/test_provider_hook_settings.py; uvx pytest -q test/test_v2_runtime_launch.py; python3 -m py_compile lib/provider_profiles/codex_home_config.py test/test_provider_hook_settings.py; git diff --check Not-tested: full repository pytest suite
agnitum2009
force-pushed
the
codex/ccb-runtime-repairs
branch
from
June 17, 2026 14:11
d21c4fb to
9505c45
Compare
Provider profiles now carry optional MCP server overrides and Codex home materialization merges them into agent-local config.toml. This gives CCB source-config authority for per-agent Codex MCP differences instead of relying on provider-state edits. Constraint: Claude has provider-native per-HOME MCP scoping, but Codex needs CCB materialization support for stable per-agent MCP configuration. Rejected: Runtime-only Codex config edits | reloads and restarts can overwrite projected provider state. Confidence: high Scope-risk: moderate Directive: Keep provider-state MCP edits as temporary recovery only; prefer provider_profile.mcp_servers for Codex source truth. Tested: python -m py_compile targeted modules; uvx pytest -q targeted provider/config/runtime tests; git diff --check Not-tested: Full repository test suite.
agnitum2009
force-pushed
the
codex/ccb-runtime-repairs
branch
from
June 17, 2026 15:15
9505c45 to
e49d4df
Compare
Provider profile materialization now records memory projection events after legacy Codex profile migration. The tests should assert the migration event contract directly instead of assuming it remains the final event. Constraint: CI records codex_memory_projection_ok after codex_profile_migration. Rejected: suppressing memory projection events | they are valid runtime evidence and covered elsewhere. Confidence: high Scope-risk: narrow Directive: Future event assertions should select the event contract being tested instead of relying on the final event position. Tested: python -m compileall -q lib bin ccb.py; uv run --with pytest --with tomli python -m pytest -q test/test_provider_profiles.py::test_materialize_codex_profile_migrates_legacy_profile_runtime_home test/test_provider_profiles.py::test_materialize_codex_profile_does_not_migrate_when_session_authority_is_malformed test/test_provider_profiles.py::test_materialize_codex_profile_migrates_legacy_sessions_with_unrelated_tmp_symlink test/test_provider_profiles.py::test_materialize_codex_profile_does_not_migrate_session_material_with_symlink test/test_provider_profiles.py::test_materialize_codex_profile_does_not_migrate_when_agent_runtime_is_active; uv run --with pytest --with tomli python -m pytest test/test_provider_profiles.py -q; git diff --check Not-tested: Full pytest had one local intermittent socket auto-delivery assertion; rerunning that single test passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the local CCB runtime repairs onto the GitHub mainline baseline. The change keeps the newer upstream Kimi launcher architecture while adding the runtime fixes needed for Hindsight, Kimi fallback extraction, and pane quiet support.
Changes
Validation
python3 -m py_compile lib/provider_backends/kimi/execution.py lib/provider_backends/pane_quiet_support/execution.py lib/provider_profiles/codex_home_config.pyuv run --with pytest --with tomli python -m pytest test/test_provider_hook_settings.py -k 'hindsight_hooks or codex_activity_hooks_and_trust_state'-> 2 passed\n-uv run --with pytest --with tomli python -m pytest test/test_native_cli_providers.py test/test_native_cli_completion.py test/test_pane_quiet_support.py-> 30 passed\n-git diff --check\n\n## Notes\n\nThe oldplans/kimi-python-fixlauncher context-file projection was not copied verbatim because current main already uses Kimi--skills-dirmaterialization. This PR preserves that newer design and ports the semantic runtime fixes around it.\n