Repository navigation
TUI: move PasClaw.Providers.Models to interface uses so dcc64 sees it - #174
Merged
Merged
Conversation
dcc64 reported:
PasClaw.TUI.pas(91): E2003 Undeclared identifier: 'TModelInfoArray'
MVCFramework.Console.pas(166): F2063 Could not compile used unit
'LoggerPro.AnsiColors.pas'
FModelMenuModels is declared as TModelInfoArray inside the TTUI class
in the interface section. Delphi requires every type named there to
be visible from the interface's uses clause — the implementation
uses isn't enough. FPC was permissive about this and built fine; the
fix is just to move PasClaw.Providers.Models into interface uses.
The F2063 LoggerPro.AnsiColors error cascades from the same root —
once dcc64 fails the TUI unit, units downstream of it report fatal
"could not compile" for whatever was next in line. Fixing the
interface-visibility error clears both diagnostics.
This was referenced Jun 7, 2026
khongten001
pushed a commit
to khongten001/PasClaw
that referenced
this pull request
Jul 13, 2026
E2003 PasClaw.TUI.pas(144) -- TToolLoopResult undeclared. Same fix shape as PR FMXExpress#174's TModelInfoArray: AccumulateLoopStats is declared in the TTUI interface section's class body, so dcc64 needs PasClaw.Tools.ToolLoop visible from the interface uses, not just the implementation. Moved it up; left a one-line comment in the impl uses pointing back. H2077 dead writes -- "value assigned to X never used": - PasClaw.Channels.LINE.pas:377 (`Root := nil`) - PasClaw.Channels.WhatsApp.pas:384 (`Root := nil`) - PasClaw.Channels.Matrix.pas:427 (`Root := nil`) Pre-try defensive init for TJsonObject.Parse. The except branch always Exits, so the nil value is never read -- Parse either assigns Root or we leave via except. - PasClaw.MCP.Hub.pas:373 (`Result := False`) Both function exits (hub success / builtin fallback) set Result := True before returning. The initial False can't survive to a read. - PasClaw.Cmd.Skills.pas:364 (`ClawNotFound := False`) Unconditionally reassigned via SameText(...) before the first read. - PasClaw.Gateway.Server.pas:1676 (`StreamClosed := Streamer.Closed`) `raise;` below unwinds the stack; the assignment is never read by anything in this method or its callers. H2219 unused private symbol: - PasClaw.Gateway.Server.pas:105 (`WriteSSE`). Streaming paths use TSSEStreamer + TLogStreamWriter.WriteSSE (a different class). The TGatewayServer copy was never wired up. Removed both declaration and implementation. W1036 maybe-uninitialized var: - PasClaw.Gateway.Server.pas:580 (`if i = 0 then;`). HandleMemoryRead declared a stray `i: Integer;` and the "silence unused-var" hack at the end read it without assignment. Removed both the decl and the hack. W1050 WideChar narrowed to byte in set: - PasClaw.Channels.Email.pas:168. Replaced the bare `Ch in ['s', 'm', ...]` with CharInSet(Ch, ['s', 'm', ...]). Same semantics on UnicodeString (default in dcc64); CharInSet handles the implicit narrowing safely.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Stacks on top of PR #173. Fixes two Delphi (dcc64) errors that surfaced when building the
/modelTUI overlay:FModelMenuModels: TModelInfoArrayis declared inside theTTUIclass in the interface section. Delphi requires every type named in an interface-section class declaration to be visible from the interface'susesclause — the implementationusesisn't enough. FPC's modedelphiwas permissive about this somakewas green; dcc64 is strict and rejects it.Fix: move
PasClaw.Providers.Modelsfrom the implementationusesto the interfaceuses, with a comment explaining why it has to live there.The
F2063 Could not compileonLoggerPro.AnsiColorscascades from the same root — once dcc64 fails the TUI unit, the units downstream of it in the compilation queue report fatal "could not compile" diagnostics. Fixing the interface-visibility error clears both.Test plan
makeclean rebuild succeeds (FPC, mode Delphi) — verifies the shuffledusesclauses don't break the FPC path eithermake test— all suites pass (smoke, hashline, toolview, server-tools, printer, utf8, schema-strip, markdown, json-utf8, model_discovery)PasClaw.dproj— confirm both E2003 and F2063 are gone/modeloverlay still opens and switches models inside the Delphi build ofpasclaw tuiStacking note
This PR is based on
claude/tui-slash-model(PR #173), so it includes the/modelslash-command commits as well. Merging this alone delivers both the feature and the Delphi build fix; merging PR #173 first would shrink this PR to the one-commituses-clause delta.Generated by Claude Code