Skip to content

Fix NowIsoUtc: use TTimeZone.Local.ToUniversalTime under Delphi - #5

Merged
FMXExpress merged 1 commit into
claude/delphi-port-fixesfrom
claude/nice-dirac-sBwXK
May 27, 2026
Merged

FMXExpress merged 1 commit into
claude/delphi-port-fixesfrom
claude/nice-dirac-sBwXK

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Summary

  • LocalTimeToUniversal is FPC-only (DateUtils unit); calling it under Delphi produces E2003 Undeclared identifier: 'LocalTimeToUniversal'
  • Guard with {$IFDEF FPC} / {$ELSE}: FPC keeps LocalTimeToUniversal(Now); Delphi uses TTimeZone.Local.ToUniversalTime(Now) from System.DateUtils (already in scope via the DateUtils import + DCC_Namespace)

Test plan

  • Build under FPC 3.2+: NowIsoUtc compiles and returns correct UTC ISO-8601 string
  • Build under Delphi Win64 / Linux64: no E2003 error; TTimeZone.Local.ToUniversalTime resolves correctly

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon


Generated by Claude Code

LocalTimeToUniversal is FPC-only (FPC DateUtils); Delphi requires
TTimeZone.Local.ToUniversalTime from System.DateUtils. Guard with
{$IFDEF FPC}/{$ELSE} so both compilers resolve correctly.

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
@FMXExpress
FMXExpress force-pushed the claude/nice-dirac-sBwXK branch from 0f6875c to 998edfd Compare May 27, 2026 06:20
@FMXExpress
FMXExpress changed the base branch from main to claude/delphi-port-fixes May 27, 2026 06:21
@FMXExpress
FMXExpress merged commit ae821da into claude/delphi-port-fixes May 27, 2026
@FMXExpress
FMXExpress deleted the claude/nice-dirac-sBwXK branch May 27, 2026 06:22
khongten001 pushed a commit to khongten001/PasClaw that referenced this pull request Jul 13, 2026
… up with fs_read

The historical snippet width of 24 tokens routinely clipped the actual
answer line out of FTS5 snippets returned by memory_search / kb_search.
LOCOMO bench numbers on the workspace memory layer:

  snippet R@10: 0.75 -> 1.0
  snippet R@1:  0.375 -> 0.875
  doc R@10:     1.0 (unchanged, was already optimal)

Two changes:

1. Lift the magic 24 into a named interface-section const
   FTS5_SNIPPET_TOKENS = 60 in PasClaw.Memory.Index, and reuse it from
   PasClaw.KB.Index so memory_search and kb_search stay aligned. 64 is
   FTS5's hard ceiling; 60 leaves slack for the highlight markers.

2. Extend rule FMXExpress#5 in PasClaw.Agent.Prompt.BuildRulesSection to tell the
   model that bounded snippets are an index hit, not a final answer --
   if the cited file is right but the answer line might fall just
   outside the window, follow up with fs_read (or kb_get) on the cited
   path before giving up.

The two fixes are complementary: a wider window lifts recall on the
common case, and the prompt nudge handles long-context documents where
even 60 tokens may not centre on the right line.
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.

2 participants