Skip to content

[Bug]: One-shot chat with --no-journal-content exits 4 after successful tool execution #1042

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

  • Searched no-journal-content and persistence degraded; no matching issue found.

Version and environment

Astra CLI/Server 0.2.11, clean main 8ee927c, Linux x86_64, isolated local service.

Actual behavior

The ordinary CLI with explicit privacy option --no-journal-content completes a minimal read/write/read task successfully, reports the correct result, then exits 4:
Session persistence degraded: journal storage policy omitted the exact canonical conversation commit for <session>.
The official audit independently confirms read_file success_count=2 and write_file success_count=1. The output file exists with its exact intended content. A caller may mistake the nonzero exit for a failed operation and repeat an already executed side effect.

Expected behavior

Define and implement the supported one-shot privacy/durability contract. Explicit content redaction must stay honored; never silently save the redacted conversation in another local artifact. The CLI should distinguish successful side effects from privacy-selected inability to persist an exact resumable journal. Preserve fail-closed reporting for genuine append failures, unknown commit outcomes, and unsafe continuation. Document the intentional effect on resumption and machine exit behavior.

Steps to reproduce

  1. Authenticate a normal CLI to a same-revision isolated server in a supported writable workspace.
  2. Run astra --model <available-model> --bare --no-journal-content chat --no-resume --permission-mode bypass -m '<write a tiny fixture and read it back>'.
  3. Verify official tool audit and exact file content independently.
  4. Observe successful tools and final answer but exit code 4 from journal commit verification.

Additional information

require_intended_conversation_commit in crates/astra-cli/src/cli/session/session_side_effects.rs rejects a journal event after the selected redaction policy has omitted its exact conversation_commit. This report does not request removing durability checks or restoring sensitive journal content. Add deterministic public-entrypoint coverage for the chosen supported contract.

Latest-main real CLI reproduction (2026-10-18)

Reproduced with clean CLI and Server built from 13797cce49dce352669c9ccc4f8d28f75712144e (Astra 0.2.11, Linux). Both variants used the same GLM-5.3 model selection and a separate new, empty Git workspace containing only a synthetic two-number input. Each performed read_file → write_file → read_file; the independently checked output was exactly 18\n.

CLI mode Time Successful tools CLI exit Reported outcome
Normal one-shot 23.345s 3 0 success=true; completed; authoritative Server terminal
Same workflow with --no-journal-content 17.904s 3 4 success=false; persistence_error after completed effects

Both completed four real provider rounds. No retry of uncertain effects or forced interruption occurred. The privacy failure remains the selected storage-policy omission of the exact canonical conversation commit.

The source path is still: explicit journal redaction suppresses the embedded conversation commit → require_intended_conversation_commit returns NotCommitted → headless persistence records a durability error → exit 4. A fix must distinguish intentional content omission from failed/unknown writes, preserve redaction across local derived artifacts, and never claim an exact resumable canonical commit when none was stored. Existing owner, lease, append/CAS and unsafe-continuation guards must remain intact. A targeted correction is being implemented; no fixed-version acceptance is claimed yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions