[pull] main from Alishahryar1:main - #253
Merged
Merged
Conversation
## Why Opening a saved code session loaded its entire transcript into an execution owner before returning a small history page. Completed transcript content then accumulated in both application state and the Codex protocol adapter. ## How Read history directly from SQLite in a consistent snapshot, selecting the requested page plus live questions, reviews, and current-turn items. Use a session lock shared with execution and a monotonic process-wide update version so history reads and live events remain ordered. Keep execution state limited to the latest run and live or unsaved records. Look up historical identities and answer receipts in SQLite when needed, preserve the transcript sequence high-water mark, and reconcile native history temporarily during resume. Add an index for active prompts. Scope protocol accumulators by thread, turn, and item, release them at turn completion or connection teardown, and project historical items without caching them. Idle native connections continue delivering late subagent reviews, questions, notices, and context updates. Full native history may still be materialized temporarily during recovery. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=70280969"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2> <!-- greptile-risk --> The confirmed performance concern does not block merging. <h2><a href="https://app.greptile.com/api/ide/codex?prompt=IMPORTANT%3A%20Work%20in%20the%20repository%20%22alishahryar1%2Ffree-claude-code%22%20on%20the%20existing%20branch%20%22ali%2Fcode-session-history-lifetimes%22.%20Checkout%20that%20branch%20%E2%80%94%20do%20NOT%20create%20a%20new%20branch%20or%20open%20a%20new%20PR.%20Push%20your%20changes%20to%20%22ali%2Fcode-session-history-lifetimes%22.%0A%0A%23%23%23%20Issue%201%0Asrc%2Ffree_claude_code%2Fruntime%2Fcode_sessions_sqlite.py%3A578-584%0ADuring%20an%20active%20turn%2C%20every%20session-detail%20request%20fetches%20and%20decodes%20every%20item%20in%20that%20run%2C%20regardless%20of%20the%2050-item%20older-history%20page%20limit.%20This%20adds%20repeated%20database%20work%20and%20transient%20memory%20use%20as%20the%20turn%20grows.%20The%20full%20active-run%20response%20existed%20before%20this%20change%3B%20rereading%20it%20from%20SQLite%20on%20each%20request%20is%20the%20new%2C%20non-blocking%20cost.%0A%0ANote%3A%20If%20this%20suggestion%20doesn't%20match%20your%20team's%20coding%20style%2C%20reply%20to%20this%20and%20let%20me%20know.%20I'll%20remember%20it%20for%20next%20time!%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=alishahryar1%2Ffree-claude-code&pr=1924&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodexDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7"><img alt="Fix All in Codex" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7" align="right"></picture></a>Findings</h2> 1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> **Active history reads grow unbounded** <a href="https://github.com/Alishahryar1/free-claude-code/pull/1924#discussion_r4116884758">▶</a> <details open><summary>Summary</summary> The PR moves paginated code-session history reads into SQLite while retaining execution identities for live updates and recovery. People refreshing a long-running turn may see slower detail reads because each request fetches and decodes the entire active run. </details> <!-- greptile_confidence_score:4 --> <sub>Reviews (1) · Last reviewed commit: ["Separate code-session history reads from..."](https://github.com/alishahryar1/free-claude-code/commit/145ad4679ea9bd0578caffae7bd63bf7290f172d)</sub> <!-- /greptile_comment -->
## Why FCC still forces tools named `Task` into foreground execution. Current Claude Code uses `Agent`, so the workaround no longer applies to it and unnecessarily changes arguments in generic Chat conversion. ## How Remove the foreground rewrite and its dedicated buffers, including the unused duplicate in the Anthropic ledger. Task calls now use ordinary argument streaming, alias restoration, validation, and repair. Update the affected behavioral coverage and smoke capability descriptions. This intentionally stops forcing foreground execution for older clients that still emit `Task`. Current Claude Code background-agent runs through FCC NIM transport already succeeded without this workaround participating. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=70308119"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 3/5</h2> <!-- greptile-risk --> Not safe to merge until both Task tool-call failures are fixed. <h2><a href="https://app.greptile.com/api/ide/codex?prompt=IMPORTANT%3A%20Work%20in%20the%20repository%20%22alishahryar1%2Ffree-claude-code%22%20on%20the%20existing%20branch%20%22ali%2Fremove-task-foreground-policy%22.%20Checkout%20that%20branch%20%E2%80%94%20do%20NOT%20create%20a%20new%20branch%20or%20open%20a%20new%20PR.%20Push%20your%20changes%20to%20%22ali%2Fremove-task-foreground-policy%22.%0A%0A%23%23%23%20Issue%201%0Asrc%2Ffree_claude_code%2Fproviders%2Fopenai_chat%2Ftool_calls.py%3A129-132%0AWhen%20a%20provider%20emits%20a%20text-form%20Task%20call%20with%20%60%3Cparameter%3Drun_in_background%3Etrue%3C%2Fparameter%3E%60%2C%20the%20parser%20produces%20the%20string%20%60%22true%22%60.%20With%20the%20Task-specific%20conversion%20removed%2C%20the%20tool-use%20input%20contains%20that%20string%20instead%20of%20a%20boolean%2C%20so%20the%20call%20fails%20a%20Task%20schema%20requiring%20a%20boolean%20and%20can%20be%20rejected%20rather%20than%20executed.%20Convert%20text-form%20boolean%20parameters%20before%20emitting%20the%20call.%0A%0A%23%23%23%20Issue%202%0Asrc%2Ffree_claude_code%2Fproviders%2Fopenai_chat%2Ftool_calls.py%3A357-360%0AIf%20an%20upstream%20provider%20finishes%20a%20Task%20call%20with%20malformed%20argument%20fragments%2C%20this%20path%20streams%20the%20fragments%20unchanged%20and%20completes%20the%20tool-use%20response%20successfully.%20The%20streamed%20input%20is%20invalid%20JSON%2C%20so%20a%20streaming%20client%20cannot%20use%20the%20call.%20The%20non-streaming%20response%20substitutes%20%60%7B%7D%60%20and%20loses%20the%20attempted%20arguments%3B%20that%20substitution%20also%20occurred%20before%20this%20change.%20Validate%20or%20handle%20the%20completed%20arguments%20before%20finishing%20the%20streamed%20tool-use%20block.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=alishahryar1%2Ffree-claude-code&pr=1925&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodexDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7"><img alt="Fix All in Codex" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7" align="right"></picture></a>Findings</h2> 1. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> **Task boolean becomes a string** <a href="https://github.com/Alishahryar1/free-claude-code/pull/1925#discussion_r4117231117">▶</a> 2. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> **Malformed Task call completes successfully** <a href="https://github.com/Alishahryar1/free-claude-code/pull/1925#discussion_r4117231121">▶</a> <details open><summary>Summary</summary> The PR removes Task-specific foreground rewriting and argument buffering, routing Task calls through ordinary Chat tool streaming. Clients need correctly typed Task arguments and valid JSON when a tool-use response completes. Text-form background arguments can now have the wrong type, and malformed arguments can produce a successfully completed stream containing invalid JSON. Both failures should be fixed before merging. </details> <!-- greptile_confidence_score:3 --> <sub>Reviews (1) · Last reviewed commit: ["Remove obsolete Task foreground intercep..."](https://github.com/alishahryar1/free-claude-code/commit/9db1a2f19f7123e8bbbc50dfcc59c16cdb878ccd)</sub> <!-- /greptile_comment -->
## Why Telegram and Discord tasks can open a terminal window for the duration of Claude's work on Windows. Their shared managed launcher redirects output but does not suppress console creation when FCC runs without a console. ## How Use Windows `CREATE_NO_WINDOW` when starting managed Claude and its process-tree stop helper, keeping messaging execution and cancellation headless. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=70313457"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2> <!-- greptile-risk --> The test-coverage concern is non-blocking; it does not make this change unsafe to merge. <h2><a href="https://app.greptile.com/api/ide/codex?prompt=IMPORTANT%3A%20Work%20in%20the%20repository%20%22alishahryar1%2Ffree-claude-code%22%20on%20the%20existing%20branch%20%22ali%2Fheadless-messaging-claude%22.%20Checkout%20that%20branch%20%E2%80%94%20do%20NOT%20create%20a%20new%20branch%20or%20open%20a%20new%20PR.%20Push%20your%20changes%20to%20%22ali%2Fheadless-messaging-claude%22.%0A%0A%23%23%23%20Issue%201%0Asrc%2Ffree_claude_code%2Fcli%2Fmanaged%2Fsession.py%3A140-142%0AThe%20managed-session%20tests%20still%20pass%20when%20this%20new%20no-console%20flag%20is%20removed.%20The%20taskkill%20test%20also%20mocks%20the%20flag%20without%20asserting%20that%20cleanup%20uses%20it.%20A%20later%20regression%20could%20bring%20back%20console%20windows%20during%20messaging%20or%20cancellation%20without%20failing%20either%20test.%20Add%20assertions%20for%20both%20Windows%20subprocess%20calls.%20This%20coverage%20gap%20is%20non-blocking.%0A%0ANote%3A%20If%20this%20suggestion%20doesn't%20match%20your%20team's%20coding%20style%2C%20reply%20to%20this%20and%20let%20me%20know.%20I'll%20remember%20it%20for%20next%20time!%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=alishahryar1%2Ffree-claude-code&pr=1927&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodexDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7"><img alt="Fix All in Codex" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7" align="right"></picture></a>Findings</h2> 1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> **Windows flag lacks test coverage** <a href="https://github.com/Alishahryar1/free-claude-code/pull/1927#discussion_r4117297647">▶</a> <details open><summary>Summary</summary> The PR adds Windows no-console flags to managed Claude launches and taskkill cleanup so messaging and cancellation do not open console windows. The relevant tests still pass when both flags are removed, leaving that behavior unprotected against regression. </details> <!-- greptile_confidence_score:4 --> <sub>Reviews (1) · Last reviewed commit: ["Trim headless launch tests and keep Wind..."](https://github.com/alishahryar1/free-claude-code/commit/ba8af5752867a95d2d515769a61ca79bb7cfee98)</sub> <!-- /greptile_comment -->
…1929) ## Why FCC inferred tool calls from ordinary model text and rejected some normally completed native function calls with malformed arguments. This could hide model output or remove the call and the harness's error result from the next turn. Removing text buffering also requires reasoning metadata to retain its identity independently of when thinking and answer blocks finish. Otherwise late metadata can lose native reasoning, overlap Messages blocks, or replay as a separate empty assistant turn. ## How - Delete both generic text-to-tool parsers. Tool-looking markup remains visible text, and native tool events supply tool calls. Move the surviving NIM schema helpers into the NIM provider. - Preserve ordinary native function argument strings through streaming translation and supported history replay. Keep decoding where object-valued Messages input or custom/search wrappers require it, and report a conversion error instead of substituting an empty object. - Collect native and structured reasoning independently of which representation is displayed. Preserve fragment order, provenance, and separation between reasoning groups. - Reserve Responses reasoning items at the first reasoning event and finalize metadata on that same item. - Close Messages thinking before streaming text or tools. Link late metadata to its original block with an explicit FCC replay association, then resolve that association within the original assistant message before any of the three upstream protocol conversions. Existing saved replay records remain readable. - Integrate replay finalization with completion and existing failure/recovery exits. Metadata alone cannot make an empty continuation successful. Accepted behavior: answers keep streaming immediately. Normally completed ordinary arguments are deliberately opaque to FCC, while malformed string history still cannot become a Messages input object. Connection retries and interrupted-tool recovery remain in place. This change does not expand the continuation collector's handling of recovery-generated opaque reasoning or regroup first-ever opaque metadata that arrives only after an answer has begun. <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=70353546"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 5/5</h2> <!-- greptile-risk --> No outstanding findings block merging. <details open><summary>Summary</summary> The PR preserves native tool arguments and reasoning during streaming and replay. Since the previous review, the e2e session-seeding test was changed to bound each operation individually. The earlier reasoning-replay issue is fixed. </details> <!-- greptile_confidence_score:5 --> <sub>Reviews (3) · Last reviewed commit: ["test: bound pagination setup operations ..."](https://github.com/alishahryar1/free-claude-code/commit/dacb3b6efc956486161effffaf3bfec97362cb15)</sub> <!-- /greptile_comment -->
## Why Integration and messaging changes currently require editing the central application runtime, where feature state and workflows are mixed with configuration transactions and process lifecycle coordination. Give each feature a clear owner so its behavior can be understood and changed independently. ## How - Move the five integration workflows, update state, and refresh tasks into `IntegrationService`. It borrows the existing configuration lock and reads current runtime state and provider catalogs. - Move messaging setup, storage initialization, platform and CLI resources, voice resources, and cleanup gates into `MessagingService`. - Keep `ApplicationRuntime` as the API facade and lifecycle coordinator. It cancels all background task groups before joining them and taking the configuration lock, then closes resources in dependency order. Failed cleanup retains ownership for retry. - Share the existing cleanup reporting helper between resource owners and adapt behavioral tests to their new ownership boundaries. - Wait for initial startup polling to settle before the browser test clicks Retry, preventing background reconciliation from disabling the button during the click.
pull
Bot
merged commit Sep 28, 2026
5dc3a67
into
Co-Contribute-OpenSource:main
10 of 11 checks passed
This branch had an error being deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )