Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Stabilize catalog notice layout and Windows fixtures

justrachfd605c6d53ab
diff --git a/apps/native/components/site/ChatColumn.tsx b/apps/native/components/site/ChatColumn.tsx
index 16807c26..cf9c6ef3 100644
--- a/apps/native/components/site/ChatColumn.tsx
+++ b/apps/native/components/site/ChatColumn.tsx
@@ -40,8 +40,8 @@ export default function ChatColumn({ thread, compact, following, register, onOpe
return () => observer.disconnect();
}, []);
const catalogNotice = catalogStatus?.error ? <div role="alert" className="px-4 py-2 text-xs text-ink-2">Could not refresh models. <button type="button" onClick={retryCatalog} className="underline">Retry</button></div> : catalogStatus?.loading ? <div role="status" className="px-4 py-2 text-xs text-ink-3">Loading models…</div> : null;
- if (!thread.messages.length && !thread.snapshot) return <div className="min-h-0 flex-1 overflow-y-auto">
- {catalogNotice}
+ if (!thread.messages.length && !thread.snapshot) return <div className="relative min-h-0 flex-1 overflow-y-auto">
+ {catalogNotice && <div className="absolute inset-x-0 top-0 z-20 bg-page">{catalogNotice}</div>}
<EmptyState compact={compact} onOpenProject={onOpenProject} onProjects={onProjects}
onContinue={onConversations} onReview={onReview} onSend={prompt.onSend} onSetting={prompt.onSetting}
health={health} history={prompt.history} cwd={prompt.root} models={prompt.models}
@@ -50,9 +50,9 @@ export default function ChatColumn({ thread, compact, following, register, onOpe
return <div ref={hostRef} className="relative flex min-h-0 flex-1 flex-col">
<ChatTranscript messages={thread.messages} register={register} following={following}
onOpenPath={onOpenPath} onReview={onReview} onAnswer={onAnswer} snapshot={thread.snapshot} onEditPrompt={onEditPrompt} busy={prompt.busy} />
+ {catalogNotice && <div className="pointer-events-auto absolute inset-x-0 top-0 z-20 bg-page">{catalogNotice}</div>}
<div ref={composerRef} data-chat-composer className={`pointer-events-none absolute inset-x-0 bottom-0 z-10 px-4 ${composer.dock} ${compact ? "py-2" : "pt-16 pb-6 sm:px-8"}`}>
<div className="pointer-events-auto mx-auto max-w-[720px]">
- {catalogNotice}
{thread.snapshot && thread.session ? <SavedSnapshot name={thread.session} cwd={thread.cwd} model={prompt.modelKey}
onRefresh={onRefresh} onContinue={onContinue} /> : <>
<ComposerAgents root={prompt.root} session={thread.session} />
diff --git a/scripts/test-eval-cache-affinity.py b/scripts/test-eval-cache-affinity.py
index bc51c705..1c539289 100644
--- a/scripts/test-eval-cache-affinity.py
+++ b/scripts/test-eval-cache-affinity.py
@@ -57,7 +57,7 @@ p = Path('.graff/traces'); p.mkdir(parents=True)
print('CACHE_OK')
print({FOOTER!r}, file=__import__('sys').stderr)
# {arm}
-''')
+''', encoding='utf-8')
binary.chmod(0o700)
out = root / 'result'
env = dict(os.environ, CODEGRAFF_API_KEY='offline-fixture-only', OPENAI_API_KEY='must-not-inherit')
diff --git a/scripts/test-workspace-lifecycle.py b/scripts/test-workspace-lifecycle.py
index 8ce04b60..124b9d78 100644
--- a/scripts/test-workspace-lifecycle.py
+++ b/scripts/test-workspace-lifecycle.py
@@ -37,9 +37,10 @@ with tempfile.TemporaryDirectory(prefix="graff-workspace-lifecycle-") as tempora
git("add", ".")
git("commit", "-qm", "initial")
(root / ".graff").mkdir()
+ cwd_command = "python3 -c 'import os; print(os.getcwd())'"
(root / ".graff/workspace.toml").write_text(
- '[scripts]\nsetup = "printf setup >> .graff/setup; pwd > .graff/setup-cwd"\n'
- 'run = "pwd > .graff/run-cwd"\narchive = "printf archive >> $GRAFF_ROOT_PATH/.graff/archive-log"\n'
+ f'[scripts]\nsetup = "printf setup >> .graff/setup; {cwd_command} > .graff/setup-cwd"\n'
+ f'run = "{cwd_command} > .graff/run-cwd"\narchive = "printf archive >> $GRAFF_ROOT_PATH/.graff/archive-log"\n'
)
# Ensure the fixture's setup directory exists in each checkout before writing.
config = root / ".graff/workspace.toml"
@@ -47,18 +48,9 @@ with tempfile.TemporaryDirectory(prefix="graff-workspace-lifecycle-") as tempora
assert "setup ok" in graff("create", "task", "main")
tree = root / ".graff/worktrees/task"
assert git("config", "branch.worktree-task.graff-base") == "main"
- def recorded_cwd(name):
- value = (tree / f'.graff/{name}-cwd').read_text().strip()
- # Git Bash pwd uses /d/... while Python on Windows uses D:\\... .
- if os.name == 'nt' and value.startswith('/'):
- drive, separator, rest = value[1:].partition('/')
- if separator and len(drive) == 1 and drive.isalpha():
- value = f'{drive}:/{rest}'
- return Path(value).resolve()
-
- assert recorded_cwd('setup') == tree.resolve()
+ assert Path((tree / ".graff/setup-cwd").read_text().strip()).resolve() == tree.resolve()
assert "run finished" in graff("run", "task")
- assert recorded_cwd('run') == tree.resolve()
+ assert Path((tree / ".graff/run-cwd").read_text().strip()).resolve() == tree.resolve()
(tree / "file").write_text("task\n")
git("add", "file", cwd=tree)
git("commit", "-qm", "task", cwd=tree)