Repository navigation
Register PasClaw.Markdown.Render in PasClaw.dproj (dcc64 F2613 fix) - #156
Merged
Merged
Conversation
dcc64 reports:
[dcc64 Fatal Error] PasClaw.Cmd.Agent.pas(50): F2613 Unit
'PasClaw.Markdown.Render' not found.
The Makefile's UNIT_DIRS list got updated for FPC but the Delphi
project file didn't. .dproj has its own list — DCC_UnitSearchPath
plus an explicit DCCReference per .pas — and adds aren't
automatically synced from the Makefile side.
Two edits in PasClaw.dproj:
1. DCC_UnitSearchPath gains \`..\\pkg\\markdown\` so dcc64 finds
the directory on the search path (mirror of the Makefile's
UNIT_DIRS += src/pkg/markdown).
2. DCCReference Include="..\\pkg\\markdown\\PasClaw.Markdown.Render.pas"
added alongside the other pkg/* entries so the unit is part
of the project (and gets a build slot in the IDE).
No source changes. FPC build still clean.
This was referenced Jun 7, 2026
khongten001
pushed a commit
to khongten001/PasClaw
that referenced
this pull request
Jul 13, 2026
…+ localvector + Cmd.Memory dcc64 F2613 on PR FMXExpress#166: PasClaw.Cmd.Memory.pas(49): Unit 'LocalVector.Models' not found. Same shape as PR FMXExpress#156's miss after PR FMXExpress#155 — the FPC Makefile got the new unit dirs but the Delphi .dproj didn't. PR FMXExpress#165 added the in-tree localvector port under src/pkg/memory/localvector/ + the new PasClaw.Memory.Vector adapter; PR FMXExpress#166 added src/cmd/PasClaw.Cmd.Memory.pas. Neither was wired into PasClaw.dproj, so the Delphi build can't resolve LocalVector.Models / LocalVector.VectorStore / LocalVector.OrtProvision / LocalVector.VecProvision / LocalVector.Downloader / etc. Edits: DCC_UnitSearchPath Added `..\pkg\memory\localvector` (right after `..\pkg\memory` to keep the source-tree shape readable). DCCReference — pkg/memory Added `..\pkg\memory\PasClaw.Memory.Vector.pas` (PR FMXExpress#165 new file). Added all 13 in-tree localvector files under a fresh `pkg/memory/localvector` comment block: LocalVector.Models.pas LocalVector.Runtime.pas LocalVector.Sqlite3.pas LocalVector.Tokenizer.pas LocalVector.Embedder.pas LocalVector.VectorStore.pas LocalVector.VectorStore.Sqlite.pas LocalVector.VectorStore.FireDAC.pas LocalVector.Downloader.pas LocalVector.OrtProvision.pas LocalVector.VecProvision.pas onnxruntime.pas onnxruntime_pas_api.pas DCCReference — cmd Added `..\cmd\PasClaw.Cmd.Memory.pas` (PR FMXExpress#166 new file). Slotted next to PasClaw.Cmd.Membench.pas, matching the .pas filename ordering already present in this block. Stacks on PR FMXExpress#166 (which stacks on PR FMXExpress#165). Lands after both; merge order FMXExpress#165 → FMXExpress#166 → this.
khongten001
pushed a commit
to khongten001/PasClaw
that referenced
this pull request
Jul 13, 2026
Lifts the "use the provider's /models endpoint" idea from UltraCode-Shim's Auto Router (and the carry-over from PR FMXExpress#163's followup question) into a complete loop: discover, cache, surface in onboarding. New unit: src/pkg/providers/PasClaw.Providers.Models.pas Three family parsers driven off TProviderSpec.Family: pfOpenAI GET <base>/v1/models, Bearer auth (or asNone for Ollama / vLLM / LM Studio). Parses `data[].id` + `data[].created`. Used by 14 catalog rows that share the OpenAI-compatible /v1/models shape — openrouter, groq, deepseek, mistral, xai, qwen, zhipu, cerebras, moonshot, ollama, vllm, lmstudio, litellm, openai. pfAnthropic GET <base>/v1/models, x-api-key + anthropic-version headers. Parses `data[].id` + `display_name` + ISO `created_at`. pfGemini GET <base>/v1beta/models, x-goog-api-key header. Strips the "models/" namespace prefix from each `name`, filters out rows that don't list "generateContent" in supportedGenerationMethods (embedders and counters live there too and would 404 the chat path). Cache at $PASCLAW_HOME/cache/models/<provider>.json with a fetched_at unix timestamp. JoinPath built up segment-by-segment so PathDelim insertion stays consistent on Windows (PR FMXExpress#169 trap). Discovery never raises; failure modes return Ok=False with a human-readable ErrMsg the caller surfaces verbatim. Empty result is Ok=True with Length=0 (the operator's call whether to retry). New subcommands: src/cmd/PasClaw.Cmd.Model.pas pasclaw model refresh <provider> hit /v1/models, save cache pasclaw model refresh --all refresh every configured row pasclaw model list <provider> show cached roster + age `pasclaw model show` now adds a cache-freshness annotation for the default provider — "models cached: 47 (refreshed 3 days ago)" or the gentle nudge "(none — run `pasclaw model refresh anthropic` to populate)" when no cache exists yet. Onboarding picker: src/cmd/PasClaw.Cmd.Onboard.pas Flipped the order: now prompts for the API key BEFORE the model, so the key is available for the /v1/models fetch. Live fetch is bounded at 8s — onboarding is interactive, a slow provider status page shouldn't make the user wait 30s. On success: numbered picker over the top 12 newest models (sorted by created_at desc), with the option to type a free-form id or hit Enter for the catalog default. On failure: falls back to the existing text prompt verbatim so a broken /v1/models never blocks first-time setup. Both the full result AND a sort-truncated view get cached, so `pasclaw model list <provider>` later shows the whole roster even though the onboarding picker only displayed the top 12. New test: src/tests/model_discovery_tests.pas Covers the cache schema contract (Save → Load round-trip preserves every field), missing-cache fallback (LoadCachedModels returns False, NOT True-with-empty-array), HumanAge bucket boundaries (minutes / hours / days / over-a-year cap), and case-insensitive ModelCachePath canonicalisation. Wired into `make test` as test-model-discovery. Updated: - src/pasclaw/PasClaw.dproj: registers PasClaw.Providers.Models so the Delphi build resolves it too (PR FMXExpress#156 / FMXExpress#167 pattern). - README.md: maintenance section adds `model refresh` / `model list` examples + explains the onboarding picker behaviour. - Makefile: adds test-model-discovery target and rolls it into the composite `test:` target. Verified end-to-end on Linux/FPC: $ pasclaw model show default provider: anthropic default model: claude-opus-4-7 models cached: (none — run `pasclaw model refresh anthropic` to populate) $ pasclaw model refresh anthropic # without a real key · fetching /models from Anthropic ... ✗ anthropic: API key required for Anthropic /models endpoint $ # synthesised cache file → list works: $ pasclaw model list openai openai (3 cached, refreshed over a year ago) · gpt-4o (GPT-4o) · gpt-4o-mini (GPT-4o Mini) · gpt-5 (GPT-5) $ make test ... all 11 test suites green including model_discovery_tests: OK Live-HTTP verification against real Anthropic / OpenAI / Gemini / xAI keys hasn't run in this environment (no real keys), but the parser tests cover the JSON shapes documented in each provider's current API reference.
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.
TL;DR
dcc64 reports after PR #155 merge:
PR #155 added the new unit dir to the Makefile's
UNIT_DIRS(for FPC) but didn't updatesrc/pasclaw/PasClaw.dproj(for Delphi). The.dprojhas its own list —DCC_UnitSearchPathplus an explicitDCCReferenceper.pas— and adds don't auto-sync from the Makefile side.Fix
Two edits in
src/pasclaw/PasClaw.dproj:DCC_UnitSearchPathgains..\pkg\markdownso dcc64 finds the directory on the unit search path (mirror of the Makefile'sUNIT_DIRS += src/pkg/markdown).DCCReferenceadded for..\pkg\markdown\PasClaw.Markdown.Render.pasalongside the otherpkg/*entries so the unit is part of the project (and gets a build slot in the IDE).No source changes. FPC build still clean (
make smokepasses).Process gap on my end
Every time I add a new unit directory I update
Makefilebut consistently forget the.dproj. Suggested follow-up: amake check-dprojtarget that diffs the.pasfiles undersrc/cmd+src/pkg/**against theDCCReferencelist, fails if any are missing. Would have caught this. Want me to add that in a separate PR?https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code