Skip to content

@harnessforce/cli@0.9.0

Choose a tag to compare

@lambdascript-github-auth lambdascript-github-auth released this 01 Dec 15:47
· 10 commits to main since this release
7983ce5

Minor Changes

  • 0447f3c: harnessforce import and harnessforce insights now read Codex rollouts compressed to .jsonl.zst when the Node.js running them can decompress zstd (22.15 or later, 23.8 or later on 23.x). A compressed rollout next to a plain one of the same name is skipped, as Codex does. On an older Node.js, harnessforce import still counts them, and the message now names the Node.js version and the versions that can read them.
  • 821e4ee: Codex sessions now send their config snapshot, so the Harness inventory counts the skills, rules, hooks, MCP servers, models and permissions Codex sessions run with, like Claude Code's. harnessforce hook session-start and harnessforce hook subagent-start collect what Codex reads: AGENTS.md (or AGENTS.override.md) in CODEX_HOME and at the repository root, skills in .agents/skills and .codex/skills, config.toml and hooks.json of the user layer, of /etc/codex (with managed_config.toml and the hooks of requirements.toml) and of a trusted project, and the enabled plugins as their manifest declares them. Like Claude Code's snapshot, it holds only names and hashes: header values, environment values, arguments, URL queries and the OAuth client secret are left out of the hashes. Hooks and permissions are named after their file (config.toml:SessionStart, config.toml:permissions) so they do not merge with Claude Code's settings. No new hook is needed. The using-harnessforce table now says both agents send the snapshot.
  • 1c72a48: harnessforce login no longer writes the user ingest key into the Codex config.toml. It writes [otel].headers_helper = "harnessforce otel-headers --agent codex" (the launcher path when the fixed location is used, harnessforce.cmd on Windows) and removes the headers of exporter and trace_exporter, so Codex reads the key from the keychain like Claude Code. harnessforce otel-headers --agent codex prints the key only when every OTLP/HTTP exporter in the config.toml of the current directory sends to the pinned origin, with the same exit codes as harnessforce otel-headers. harnessforce logout removes the helper. Codex 0.170.0 or later is required: harnessforce login prints a line when codex --version is older, and harnessforce status reports Codex older than 0.170.0. Run harnessforce login again to replace the key in an existing config.toml. The Codex SessionStart hook's warnings for a missing or unreadable ingest key now say that telemetry is not sent either, since Codex reads the key from the same keychain.
  • 95ddaa3: harnessforce hook session-start, post-tool-use and stop now pick the key like the Claude Code plugin hook. When the Claude Code managed settings file (managed-settings.json and the .json files in managed-settings.d/ not starting with .) has HARNESSFORCE_INGEST_KEY in env, the Codex hooks send with that Workspace key to that file's HARNESSFORCE_ENDPOINT without reading the keychain, and do not add issue_identifier or source=cli. A 401 with the Workspace key tells the user to contact a Workspace administrator. Without that key, the hooks keep using the user ingest key from the keychain. This lets an organization that distributes /etc/codex/requirements.toml register Codex sessions in the same Workspace as their telemetry.
  • cba7f9d: harnessforce insights now analyzes Codex rollouts in ~/.codex/sessions/ as well as Claude Code sessions, and sends their analysis reports with agent: "codex" (without first_prompt_id). The rollout's instructions, agent messages, shell commands, file changes and MCP calls are read as the Claude Code elements they correspond to, so the same rules and vocabulary decide the interventions, loops and MCP servers; the listed MCP servers come from the Codex configuration (~/.codex/config.toml and the trusted project's .codex/config.toml, not CODEX_HOME). A rollout that is not written in the paginated history format reports its interventions, loops and MCP servers as not measured. Subagent threads are not analyzed on their own: their responses count toward the parent's subagent_models, and they are imported with the parent before sending. Terminal-only usage adds compactions; Codex sessions have null auto and manual counts and match frequent_compaction from 2 compactions. Suggestions stay Claude Code only: sufficient and "Not enough data" count Claude Code sessions, a line says how many Codex sessions were analyzed, harnessforce insights record rejects a Codex session as evidence, and /harnessforce:insights judges its targets from Claude Code sessions. analyzer_version is now 1.2.0.
  • 35c8986: harnessforce otel-headers --agent codex now also prints "Harnessforce-Send-Content": "on" or "off", read like harnessforce config get send-content (on when ~/.harnessforce/config.json or its send_content is missing). When that file cannot be read, is not a JSON object, or send_content is not a boolean, the header is off and the key is still printed with exit 0, since Codex stops sending all telemetry while the helper fails. Codex sends tool arguments and output regardless of log_user_prompt and log_agent_responses, so Harnessforce does not store content from a request whose header is off. harnessforce otel-headers for Claude Code is unchanged.
  • 15d7a4f: Codex subagents are no longer dropped. A Codex subagent runs in its own thread, which Codex never starts with SessionStart, so Harnessforce could not tell which project its telemetry belonged to and discarded it. harnessforce login now adds a SubagentStart hook (harnessforce hook subagent-start, asynchronous) to Codex's config.toml: it registers the subagent's thread as its own session with the repository, branch and commit of the working directory, so the subagent's work is kept and linked to the same pull request and Issue as the parent session. It prints nothing, because Codex adds its output to the subagent's context. Run harnessforce login again and trust the new hook with /hooks in Codex. harnessforce logout removes it. The using-harnessforce table gains a SubagentStart row.
  • 91512c6: harnessforce login now also writes [otel].trace_exporter to the Codex config.toml, sending Codex traces to the ingest endpoint's /v1/traces with the same key, so Codex turns appear in Tracing like Claude Code's. harnessforce logout removes it. Run harnessforce login again to add it to an existing config.toml.
  • 72cde2e: Codex no longer loses a session's registration when its SessionStart hook fails or times out. harnessforce login adds a UserPromptSubmit hook (harnessforce hook user-prompt-submit, asynchronous) to Codex's config.toml: on the first prompt of a session, it resends the registration SessionStart saved when that send failed, or registers the session from the prompt's working directory when SessionStart saved nothing. It sends nothing when SessionStart already registered the session. Run harnessforce login again and trust the new hook with /hooks in Codex. harnessforce logout removes it. The using-harnessforce table now describes the UserPromptSubmit row for both agents.

Patch Changes

  • 9afe7cd: harnessforce login now writes the Codex PostToolUse hook with matcher = "^(apply_patch|Bash)$" and replaces the ^apply_patch$ matcher an earlier login wrote (a matcher you changed is kept). harnessforce hook post-tool-use records the working tree of the absolute path a Bash command first moves to (cd <absolute path> && or git -C <absolute path> at its start, whatever its exit code; not on Windows), so work done only through shell commands in a worktree links to its pull request. Only that path is read; the rest of the command is neither recorded nor sent. harnessforce hook session-start now registers a Codex session whose source is fork, since a forked session has a new session ID. Run harnessforce login again and trust the changed hook in /hooks; until you do, Codex runs neither apply_patch nor Bash through it.
  • 0b4458f: harnessforce hook post-tool-use now also records the working tree of the directory a Codex Bash command ran in. Codex runs each command in its own working directory (the workdir argument), which does not appear in the command text and does not change the session's directory, so work done there, such as git commit in a worktree, now links to its pull request, as Claude Code's CwdChanged does. Only the repository and branch are sent, never the path.
  • 1dd5727: harnessforce login now writes the Codex OTLP endpoint with the logs path (<ingest>/v1/logs). Codex uses the endpoint as the full logs URL, so the base URL written before sent every Codex log to the ingest root, where it was rejected and no Codex session reached Harnessforce. Run harnessforce login again to fix an existing config.toml.
  • 3b58c2e: After writing the Codex configuration, harnessforce login now shows how to pin the Harnessforce plugin for Codex: run codex plugin marketplace remove harnessforce-agent, then codex plugin marketplace add lambda-script/harnessforce-agent --ref @harnessforce/claude-code-plugin@<version> with the version codex plugin list shows. In our check, Codex 0.172.0 reinstalled the plugin at startup after the marketplace changed. The line comes after the plugin install line, and the MCP login line now follows both.
  • 14ab958: Codex can now install the Harnessforce plugin for its skills, so a Codex agent records sessions on Issues with record-session as Claude Code does. Run codex plugin marketplace add lambda-script/harnessforce-agent and codex plugin add harnessforce@harnessforce-agent. The plugin's new .codex-plugin/plugin.json gives Codex record-session, using-harnessforce and diagram only: Codex no longer loads the Claude Code hooks, the MCP server whose URL it cannot expand, or the commands (Codex keeps its hooks and MCP server from harnessforce login). harnessforce login shows the two commands after writing the Codex configuration, and record-session tells a Codex user how to fix a hook that is not running.
  • 6e25761: harnessforce run --issue <id> -- codex now starts Codex with --no-daemon, so the Codex SessionStart hook receives HARNESSFORCE_ISSUE even when Codex's shared background server is already running, and it no longer sets OTEL_BLRP_SCHEDULE_DELAY=60000: Codex waits at most 500 ms to send at exit, so a one-minute interval lost short sessions entirely. The Codex hook no longer warns that Codex sends every second.
  • ced6afb: The Claude Code plugin's work location hook now also runs on PostToolUse of Bash (matcher ^(Write|Edit|Bash)$) and records the working tree of the absolute path a command first moves to (cd <absolute path> && or git -C <absolute path> at its start; not on Windows), so work a session or its subagents do only through shell commands in a worktree links to its pull request. Only commands that succeeded are observed, since a failed one runs PostToolUseFailure. Only that path is read; the rest of the command is neither recorded nor sent. The using-harnessforce text that both the plugin and harnessforce add to the context now lists Bash among the tools after which the working tree is noted.