Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A small Go HTTP service that answers questions about a sample repository by asking a model to call code-search and file-reading tools.

The included model is deterministic. It keeps the exercise reproducible and removes the need for API keys, while preserving the control flow of a tool-using agent.
The included model (`scriptedModel`) is a deterministic test double. Its scripted responses keep the exercise reproducible and remove the need for API keys while preserving the control flow of a tool-using agent. It is not intended to simulate or be improved as a language model; focus on the agent harness and its behavior around the model boundary.

The candidate is required to use an agentic coding assistant (Amp, Claude Code, Codex, Cursor, etc.) during the interview.

Expand Down
2 changes: 1 addition & 1 deletion agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func TestAgentAnswersAfterOneToolCall(t *testing.T) {
agent := newAgent(demoModel{}, newTools("sample-repo"))
agent := newAgent(scriptedModel{}, newTools("sample-repo"))

result, err := agent.run(context.Background(), "Where is ErrUnauthorized defined?")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
log.Fatalf("resolve root: %v", err)
}

agent := newAgent(demoModel{}, newTools(absRoot))
agent := newAgent(scriptedModel{}, newTools(absRoot))
mux := http.NewServeMux()
mux.HandleFunc("POST /answer", func(w http.ResponseWriter, r *http.Request) {
var req answerRequest
Expand Down
10 changes: 5 additions & 5 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func (u *usage) add(other usage) {
u.CostUSD += other.CostUSD
}

// demoModel stands in for a hosted model so the interview is deterministic and
// does not require credentials. Its responses exercise the same model boundary
// as a production implementation.
type demoModel struct{}
// scriptedModel stands in for a hosted model so the interview is deterministic
// and does not require credentials.
// Its responses exercise the same model boundary as a production implementation.
type scriptedModel struct{}

func (demoModel) next(ctx context.Context, question string, results []toolResult) (modelResponse, error) {
func (scriptedModel) next(ctx context.Context, question string, results []toolResult) (modelResponse, error) {
if err := ctx.Err(); err != nil {
return modelResponse{}, err
}
Expand Down