Skip to content

Fix documentation accuracy issues#354

Merged
patniko merged 1 commit intomainfrom
docs-fixes
Feb 4, 2026
Merged

Fix documentation accuracy issues#354
patniko merged 1 commit intomainfrom
docs-fixes

Conversation

@patniko
Copy link
Contributor

@patniko patniko commented Feb 4, 2026

Summary

Fixes documentation accuracy issues found during audit.

Go SDK Fixes

  • NewClient returns *Client only (no error tuple)
  • NewClient takes *ClientOptions (pointer), not ClientOptions
  • CreateSession requires context.Context as first parameter
  • SessionConfig must be passed as pointer (&copilot.SessionConfig{})

Files updated:

  • docs/debugging.md
  • docs/hooks/overview.md
  • docs/hooks/pre-tool-use.md
  • docs/hooks/post-tool-use.md
  • docs/hooks/user-prompt-submitted.md
  • docs/hooks/error-handling.md

Session API Fixes

  • sendPrompt/SendPrompt doesn't exist - SDK uses send/sendAndWait
  • Updated all TypeScript, Python, Go, and .NET examples

File updated:

  • docs/guides/session-persistence.md

Link Fixes

  • Fixed broken link ./mcp.md./mcp/overview.md (file was moved)

File updated:

  • docs/getting-started.md

Go SDK fixes:
- NewClient returns *Client (not error), takes *ClientOptions
- CreateSession requires context.Context and *SessionConfig (pointer)
- Updated all Go examples in debugging.md, hooks/*.md

Session API fixes:
- sendPrompt/SendPrompt doesn't exist - use send/sendAndWait
- Fixed all TypeScript, Python, Go, .NET examples in session-persistence.md

Link fixes:
- getting-started.md: ./mcp.md → ./mcp/overview.md (file moved)
@patniko patniko requested a review from a team as a code owner February 4, 2026 05:06
Copilot AI review requested due to automatic review settings February 4, 2026 05:06
@patniko patniko merged commit fc731f0 into main Feb 4, 2026
14 checks passed
@patniko patniko deleted the docs-fixes branch February 4, 2026 05:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes documentation accuracy issues found during an audit, specifically correcting Go SDK API signatures and session API method names across multiple documentation files.

Changes:

  • Fixed Go SDK API signatures: NewClient takes *ClientOptions pointer and returns only *Client, CreateSession requires context.Context as first parameter and takes &copilot.SessionConfig{} pointer
  • Corrected session API method names from non-existent sendPrompt/SendPrompt to actual SDK methods send/sendAndWait/SendAndWait/SendAndWaitAsync across TypeScript, Python, Go, and .NET examples
  • Fixed broken MCP documentation link from ./mcp.md to ./mcp/overview.md

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/debugging.md Fixed Go NewClient to accept &copilot.ClientOptions{} pointer parameter instead of value
docs/hooks/overview.md Added context import, fixed NewClient and CreateSession signatures, added _ = session to avoid unused variable warning
docs/hooks/pre-tool-use.md Fixed CreateSession to use context.Background() and &copilot.SessionConfig{} pointer
docs/hooks/post-tool-use.md Fixed CreateSession to use context.Background() and &copilot.SessionConfig{} pointer
docs/hooks/user-prompt-submitted.md Fixed CreateSession to use context.Background() and &copilot.SessionConfig{} pointer
docs/hooks/error-handling.md Fixed CreateSession to use context.Background() and &copilot.SessionConfig{} pointer
docs/guides/session-persistence.md Corrected method names from sendPrompt/SendPrompt to sendAndWait/SendAndWait/send_and_wait/SendAndWaitAsync across all languages; fixed Go NewClient and CreateSession signatures; contains bug in ResumeSession call
docs/getting-started.md Fixed broken MCP documentation link to correct path

```go
// Resume from a different client instance (or after restart)
session, _ := client.ResumeSession("user-123-task-456", copilot.ResumeSessionOptions{})
session, _ := client.ResumeSession(context.Background(), "user-123-task-456", nil)
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ResumeSession method only takes two arguments: ctx context.Context and sessionID string. The third nil argument should be removed. According to the Go SDK source code (go/client.go:660), the correct signature is func (c *Client) ResumeSession(ctx context.Context, sessionID string) (*Session, error). If additional options are needed, use ResumeSessionWithOptions instead.

Suggested change
session, _ := client.ResumeSession(context.Background(), "user-123-task-456", nil)
session, _ := client.ResumeSession(context.Background(), "user-123-task-456")

Copilot uses AI. Check for mistakes.
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.

1 participant