Skip to content

chore(merge): resolve autosubmit PR conflicts with latest main#2

Merged
dmego merged 1 commit intofeat-autosubmit-schedulingfrom
codex/fix-pr-conflicts-351
Apr 22, 2026
Merged

chore(merge): resolve autosubmit PR conflicts with latest main#2
dmego merged 1 commit intofeat-autosubmit-schedulingfrom
codex/fix-pr-conflicts-351

Conversation

@Codex
Copy link
Copy Markdown

@Codex Codex AI commented Apr 22, 2026

PR 351 conflicted with upstream main; reconciled autosubmit scheduling work with new TUI cache warm command and core parser/pricing updates.

  • Merge alignment

    • Pulled upstream main into feat-autosubmit-scheduling, resolving Cargo.lock/version drift (workspace + packages now 2.0.27).
    • Kept autosubmit commands/tests intact while integrating new hidden warm-tui-cache command and detached warm-up spawn after submit.
  • TUI polish

    • Set terminal title to “Tokscale”; clear it on exit and failure paths.
  • Core ingestion/pricing

    • Adopted upstream OpenCode SQLite-first dedup, forked-session collapse, and added regression guards.
    • Synced Gemini cost calculation to use full token breakdown (includes cache reads).
    • Harmonized AMP session parsing to recover dates from partial ledgers.

Example: detached TUI cache warm-up after submit

fn spawn_warm_tui_cache_detached() {
    if let Ok(exe) = std::env::current_exe() {
        let _ = Command::new(exe)
            .arg("warm-tui-cache")
            .stdin(Stdio::null())
            .stdout(Stdio::null())
            .stderr(Stdio::null())
            .spawn();
    }
}

Summary by cubic

Merges autosubmit scheduling with the latest main and resolves conflicts. Adds a hidden TUI cache warm command, improves ingestion accuracy for OpenCode/AMP/Gemini, and polishes the TUI.

  • New Features

    • Add hidden warm-tui-cache command; submit spawns it detached to warm the default TUI view without blocking.
    • Set terminal title to “Tokscale” on launch and clear it on exit/failure.
  • Bug Fixes

    • OpenCode: Prefer SQLite, deduplicate across opencode*.db, and collapse forked session history; preserve cross-source dedup with JSON; regression tests added.
    • AMP: Merge partial ledgers with message usage, recover timestamps from thread created or file mtime, and avoid double counting; tests added.
    • Gemini: Normalize cache-inclusive inputs (input excludes cache hits) and include cache reads in cost calculation; tests added.
    • Source cache: bump schema to 6 and fix file locking to avoid stale reads.
    • Bump workspace and packages to 2.0.27, including @tokscale/cli and platform binaries; update coverage badge to 43%.

Written for commit 4ec9d94. Summary will update on new commits.

Co-authored-by: dmego <22118976+dmego@users.noreply.github.com>
@Codex Codex AI assigned Codex and dmego Apr 22, 2026
@dmego dmego marked this pull request as ready for review April 22, 2026 05:58
Copilot AI review requested due to automatic review settings April 22, 2026 05:58
@dmego dmego merged commit f487653 into feat-autosubmit-scheduling Apr 22, 2026
8 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Resolves conflicts with latest main while aligning autosubmit scheduling work with upstream core ingestion/pricing updates and new TUI cache-warm behavior.

Changes:

  • Bump workspace + package versions to 2.0.27 across Rust + npm packages.
  • Core parsing updates: OpenCode SQLite-first dedup (incl. forked-session collapse), Gemini cached-token normalization for pricing, and AMP ledger/message timestamp reconciliation with new regression tests.
  • CLI/TUI updates: hidden warm-tui-cache command (spawned detached after submit) and terminal title set/cleared for the TUI.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/tokscale/package.json Bumps published alias package + dependency on @tokscale/cli to 2.0.27.
packages/cli/package.json Bumps CLI version and all optional binary package versions to 2.0.27.
packages/cli-win32-x64-msvc/package.json Bumps Windows x64 binary package to 2.0.27.
packages/cli-win32-arm64-msvc/package.json Bumps Windows arm64 binary package to 2.0.27.
packages/cli-linux-x64-musl/package.json Bumps Linux x64 musl binary package to 2.0.27.
packages/cli-linux-x64-gnu/package.json Bumps Linux x64 gnu binary package to 2.0.27.
packages/cli-linux-arm64-musl/package.json Bumps Linux arm64 musl binary package to 2.0.27.
packages/cli-linux-arm64-gnu/package.json Bumps Linux arm64 gnu binary package to 2.0.27.
packages/cli-darwin-x64/package.json Bumps macOS x64 binary package to 2.0.27.
packages/cli-darwin-arm64/package.json Bumps macOS arm64 binary package to 2.0.27.
crates/tokscale-core/src/sessions/opencode.rs Adds SQLite fingerprint-based dedup to collapse forked-session history; expands tests around dedup keys and fork collapse.
crates/tokscale-core/src/sessions/gemini.rs Normalizes cached prompt overlap so pricing can charge cache reads correctly; adds regression tests.
crates/tokscale-core/src/sessions/amp.rs Reconciles ledger + per-message usage to recover timestamps/dates from partial ledgers; adds parser-focused tests.
crates/tokscale-core/src/message_cache.rs Updates cache locking call style and bumps cache schema version.
crates/tokscale-core/src/lib.rs Applies unified pricing calculation (incl. Gemini cache_read) and adds integration/regression tests for OpenCode/AMP/Gemini changes.
crates/tokscale-cli/src/tui/mod.rs Sets terminal title to “Tokscale” on entry and clears it on exit/error/panic paths.
crates/tokscale-cli/src/main.rs Adds hidden warm-tui-cache subcommand and spawns it detached after submit to warm caches.
Cargo.toml Bumps workspace package version to 2.0.27.
Cargo.lock Updates lockfile crate versions to 2.0.27.
.github/badges/coverage.svg Updates coverage badge from 41% to 43%.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

use std::time::UNIX_EPOCH;

const CACHE_SCHEMA_VERSION: u32 = 5;
const CACHE_SCHEMA_VERSION: u32 = 6;
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CACHE_SCHEMA_VERSION was bumped from 5 → 6, but the diff here doesn’t appear to change the serialized cache format (only the locking call site). If the on-disk CachedSourceStore layout is unchanged, consider keeping the schema version the same to avoid invalidating every user’s warm cache unnecessarily; if there is a format/layout change elsewhere, please add a brief comment explaining why the bump is required.

Suggested change
const CACHE_SCHEMA_VERSION: u32 = 6;
const CACHE_SCHEMA_VERSION: u32 = 5;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants