Skip to content

Latest commit

 

History

History
81 lines (70 loc) · 6.41 KB

File metadata and controls

81 lines (70 loc) · 6.41 KB

Progress Log

Session: 2026-08-05

Phase 2-7: Codex Support Implementation

  • Status: Phases 2-6 complete; Phase 7 automated verification complete (live manual verification pending).
  • Actions taken:
    • Phase 2: Added Agent to ipc.Request/ipc.SessionInfo/session.Session (empty → claude, normalized on Load), config.codex_bin. Backward-compat tests.
    • Phase 3: Split hook.Run into provider-aware dispatch. Verified the Codex hook contract against local Codex 0.146.0 + CodeIsland source: PermissionRequest output identical envelope to Claude's; {} defers; PreToolUse deny-only → not installed for Codex. New internal/codexrules package: prefix_rule derivation/escaping/dedup, MCP approval_mode in config.toml, auto-review defer. Table-driven tests.
    • Phase 4: Interactive agent selection in codelark install (Claude/Codex/both, default = detected set); codex hooks.json installer that merges with other tools (CodeIsland) and never adds unknown fields; uninstall removes only codelark-owned entries; hook-trust note printed. Tests.
    • Phase 5: runAgentTmux generic launch, larkcodex symlink, codelark tmux --agent parsing, resolveCodex/tmux.CodexPath resolution, /new dual-agent buttons. Tests.
    • Phase 6: Agent labels on all cards (card.AgentLabel), codex 始终允许 out-of-band persistence in resolveApprovalAction with degradation + card reporting. Tests.
    • Phase 7: go test ./... 9/9 green, go vet clean, hook CLI smoke tests, README/install.sh/usage() updated.
  • Files created/modified: see git diff (task_plan.md, findings.md, progress.md, internal/codexrules/, internal/hook/, internal/daemon/, internal/card/, internal/ipc/, internal/session/, internal/tmux/, internal/prompt/, internal/config/*, main.go, main_test.go, README.md, install.sh).

Phase 1: Requirements & Discovery

  • Status: complete
  • Started: 2026-08-05
  • Actions taken:
    • Reviewed current Claude hook, daemon, IPC, tmux, config, card, and CLI coupling points.
    • Confirmed tmux functions are generic enough for Codex.
    • Confirmed local Codex binary and version: codex-cli 0.146.0.
    • Confirmed local Codex uses ~/.codex/hooks.json and hook trust state in ~/.codex/config.toml.
    • Created handoff plan for another agent.
    • Updated the plan per user direction: codelark install must prompt interactively for which agents to wire.
    • Updated the plan per user question: Codex 始终允许 must not use hook updatedPermissions.
    • Inspected CodeIsland's Codex always-allow implementation and updated plan with a CodeIsland-parity option.
    • Updated the plan per user direction: first Codex release must implement CodeIsland-parity 始终允许, not an MVP subset.
    • Inspected CodeIsland's ExitPlanMode handling: normal PermissionRequest path, configurable auto-approve, default off.
    • Re-checked CodeIsland source line references and compared them with codelark's existing ExitPlanMode product-boundary handling.
    • Updated plan/findings to keep Claude ExitPlanMode exception unless new manual evidence disproves it, while requiring Codex behavior verification.
    • Re-verified the ExitPlanMode remote-approval boundary with a terminal-confirmed test; cross-tested a third-party tool, CodeIsland, approving the same prompt remotely, which also failed to unblock Claude Code. Logged as corroboration, not independently documented.
  • Files created/modified:
    • task_plan.md created.
    • findings.md created.
    • progress.md created.
    • task_plan.md updated with interactive install UX requirements.
    • findings.md updated with install UX decision and risk.
    • progress.md updated with this note.
    • task_plan.md updated with provider-specific 始终允许 handling.
    • findings.md updated with Codex PermissionRequest constraints.
    • task_plan.md updated to describe CodeIsland-style Codex rule persistence.
    • findings.md updated with CodeIsland source references and implementation details.
    • task_plan.md updated to make Codex 始终允许 mandatory and set $CODEX_HOME/rules/codelark.rules.
    • findings.md updated to remove the conservative-MVP option for Codex 始终允许.
    • findings.md updated with CodeIsland ExitPlanMode handling.
    • findings.md updated with line-level CodeIsland and codelark ExitPlanMode references.
    • task_plan.md updated with explicit ExitPlanMode implementation guidance.
    • docs/backlog.md updated with cross-tool corroboration (CodeIsland remote approval also fails to unblock Claude Code on ExitPlanMode).

Test Results

Test Input Expected Actual Status
go test ./... Full suite All pass 9/9 packages pass PASS
go vet ./... Full build Clean Clean PASS
Hook CLI smoke (built binary) Claude/Codex PermissionRequest, Codex PreToolUse, SessionStart, Stop, no daemon Defer {} (PreToolUse: empty stdout) Matched PASS
Codex always-allow persistence daemon test, temp $CODEX_HOME Writes rules/codelark.rules / config.toml, plain allow, card outcome PASS
hooks.json merge/dedup install/uninstall with CodeIsland-style entries Other tools' hooks preserved, codelark idempotent PASS
--agent parsing codelark tmux --agent codex -r x Strips flag, forwards rest PASS

Error Log

Timestamp Error Attempt Resolution
2026-08-05 None during planning 1 Planning completed without implementation errors.
2026-08-05 tomlKeySegment cutset bug (all TOML segments quoted) 1 Explicit safe-char loop + tests
2026-08-05 Codex shape test asserted forbidden fields present 1 Rewrote to lock omitempty contract
2026-08-05 Card tests asserted pre-Codex copy/buttons 2 Updated assertions

5-Question Reboot Check

Question Answer
Where am I? Phases 2-6 complete; Phase 7 automated verification done; live manual verification pending.
Where am I going? User manually verifies: larkcodex, codelark tmux --agent codex, Codex /workspace + approval + 始终允许, hook trust.
What's the goal? Add Codex as a first-class codelark agent type while preserving Claude behavior.
What have I learned? See findings.md + task_plan.md checkboxes.
What have I done? Implemented all phases: agent model, hook provider split, codexrules, install/uninstall, tmux shortcuts, cards, verification.