Skip to content

Commit d3e07ea

Browse files
committed
docs: Add new journal entry and update DevContainer report for December 24, 2025
- Created a journal entry discussing challenges and insights related to configuring LangChain assistants and multi-environment DevContainer setups. - Included code examples using Pydantic and Dataclasses for agent configuration, enhancing documentation for developers. - Updated the existing DevContainer report with reflections on using Git worktrees and Docker for isolated development environments.
1 parent 785dfae commit d3e07ea

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

journals/2025_12_24.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
- [[LangChain/Ecosystem]]
2+
- for some reason it's always so hard for me to find [Observability in Studio - Docs by LangChain](https://docs.langchain.com/langsmith/observability-studio#full-example-configuration), which is, to the best of my knowledge, one of the only pieces of documentation which shows how to do this configuration of langgraph assistants using `Annotated[Literal{}]` and `json_schema_extra`
3+
- ```python
4+
## Using Pydantic
5+
from pydantic import BaseModel, Field
6+
from typing import Annotated, Literal
7+
8+
class Configuration(BaseModel):
9+
"""The configuration for the agent."""
10+
11+
system_prompt: str = Field(
12+
default="You are a helpful AI assistant.",
13+
description="The system prompt to use for the agent's interactions. "
14+
"This prompt sets the context and behavior for the agent.",
15+
json_schema_extra={
16+
"langgraph_nodes": ["call_model"],
17+
"langgraph_type": "prompt",
18+
},
19+
)
20+
21+
model: Annotated[
22+
Literal[
23+
"anthropic/claude-sonnet-4-5-20250929",
24+
"anthropic/claude-haiku-4-5-20251001",
25+
"openai/o1",
26+
"openai/gpt-4o-mini",
27+
"openai/o1-mini",
28+
"openai/o3-mini",
29+
],
30+
{"__template_metadata__": {"kind": "llm"}},
31+
] = Field(
32+
default="openai/gpt-4o-mini",
33+
description="The name of the language model to use for the agent's main interactions. "
34+
"Should be in the form: provider/model-name.",
35+
json_schema_extra={"langgraph_nodes": ["call_model"]},
36+
)
37+
38+
## Using Dataclasses
39+
from dataclasses import dataclass, field
40+
41+
@dataclass(kw_only=True)
42+
class Configuration:
43+
"""The configuration for the agent."""
44+
45+
system_prompt: str = field(
46+
default="You are a helpful AI assistant.",
47+
metadata={
48+
"description": "The system prompt to use for the agent's interactions. "
49+
"This prompt sets the context and behavior for the agent.",
50+
"json_schema_extra": {"langgraph_nodes": ["call_model"]},
51+
},
52+
)
53+
54+
model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
55+
default="anthropic/claude-3-5-sonnet-20240620",
56+
metadata={
57+
"description": "The name of the language model to use for the agent's main interactions. "
58+
"Should be in the form: provider/model-name.",
59+
"json_schema_extra": {"langgraph_nodes": ["call_model"]},
60+
},
61+
)
62+
```
63+
- [[DevContainer/Report/25/12/Multi-Env DevContainer Setup]]
64+
- This morning I was about to start on [🐛 fix(devcontainer): docker-compose.override.yml not picked up by JetBrains Gateway rebuilds · Issue #718 · codekiln/langstar](https://github.com/codekiln/langstar/issues/718) with the plan to make multiple devcontainer configurations in [[Langstar]], and I opened a devcontainer for [[JetBrains/RustRover]] inside of a [[git/worktree]] that was at `<repo-root>/wip/<branch>`. When I got it open, I had problems with accessing git, which makes sense; there was no [[git/.git]] directory.
65+
- This made me wonder ... what's the fastest, best, most secure way to spin up a different devcontainer for each [[AI/Coding/Agent]] while keeping them isolated? Sure, git worktrees let you parallelize development, but the ability to do git work in that environment is conditioned on your ability to access the .git directory.
66+
- But if I really am making a clone from VCS of the entire repo, including the .git dir, and running it in its own unique space with [[Docker]], then why are [[git/worktree]]s even necessary?
67+
-

pages/DevContainer___Report___25___12___Multi-Env DevContainer Setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- # Multi-Environment DevContainer Setup: Patterns and Best Practices
1+
# Multi-Environment DevContainer Setup: Patterns and Best Practices
22
- ## Section 1: Official Guidance (Microsoft & JetBrains) on Multi-Environment DevContainers
33
- **Dev Container Spec & Configuration:** The Development Containers (devcontainer) specification is an open standard (now at containers.dev) supported by VS Code, Codespaces, JetBrains IDEs, and others. It does **not** provide built-in conditional logic or dynamic includes based on environment – each `devcontainer.json` defines one container configuration. However, you *can* include multiple devcontainer definitions in a repo (in subfolders) and select one at creation time [^1]. For example, GitHub Codespaces supports multiple devcontainer configs and will prompt the user to choose one when creating a codespace [^2]. There is no inheritance or automatic merging of settings between multiple configs – they are distinct parallel definitions [^2].
44
- **Default Mount Behavior:** By default, VS Code's devcontainers **bind-mount the workspace folder** from the host into the container (for local and Codespaces usage) [^3]. This is convenient, but on certain platforms (e.g. Docker Desktop on Mac/Windows) it relies on file-sharing mechanisms (osxfs, gRPC FUSE) that can be slow or memory-intensive. Microsoft's documentation notes you can override this via the `workspaceMount` property to use a **named volume** instead of a bind mount [^4]. In fact, Microsoft explicitly suggests using a named volume for the entire source tree when working with remote Docker hosts or to improve performance [^4]. This technique seeds the container with a fresh clone of the repo inside a Docker volume rather than mounting from the host.
@@ -59,4 +59,4 @@
5959
- [^17]: https://medium.com/code-and-coffee/aint-no-mountain-high-enough-devcontainers-github-codespaces-and-intellij-8ad4a42e2b3b
6060
- [^18]: https://medium.com/code-and-coffee/aint-no-mountain-high-enough-devcontainers-github-codespaces-and-intellij-8ad4a42e2b3b
6161
- [^19]: https://blog.kinto-technologies.com/posts/devcontainer_codespaces_en/
62-
- [^20]: https://www.jetbrains.com/help/idea/faq-about-dev-containers.html
62+
- [^20]: https://www.jetbrains.com/help/idea/faq-about-dev-containers.html

0 commit comments

Comments
 (0)